Changeset 24 in dev for ProjectEditor/ProjectEditor.cpp
- Timestamp:
- Dec 30, 2006, 10:18:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/ProjectEditor.cpp
r22 r24 135 135 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){ 136 136 //コントロールタブスペースの幅と行番号の文字数を更新 137 MdiInfo[WndNum].p mti->iWidth_ControlTabSpace=138 GetControlTabSpace(WndNum,&MdiInfo[WndNum].p mti->iLineNumberTextCount);139 140 InvalidateRect(MdiInfo[WndNum].p mti->hEdit,NULL,0);141 InvalidateRect(MdiInfo[WndNum].p mti->pobj_Ruler->hRulerWnd,NULL,0);137 MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace= 138 GetControlTabSpace(WndNum,&MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount); 139 140 InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0); 141 InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0); 142 142 143 143 SendTextEditResizeEvent(MdiInfo[WndNum].hwnd); … … 160 160 sw=0; 161 161 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){ 162 if( MdiInfo[WndNum].pmti->bModify) sw=1;162 if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ) sw=1; 163 163 } 164 164 else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){ … … 205 205 206 206 //サイズ 207 BufSize=(double)lstrlen(MdiInfo[WndNum].p mti->buffer);207 BufSize=(double)lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer); 208 208 if(IsWindow(hChild)){ 209 209 if(BufSize<1024) sprintf(temporary,"%s: %.0fByte",STRING_SIZE,BufSize); … … 225 225 //日本語 226 226 sprintf(temporary,"%d 行、%d 列", 227 MdiInfo[WndNum].p mti->StartCaretPos.y+1,228 MdiInfo[WndNum].p mti->StartCaretPos.x+1);227 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1, 228 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1); 229 229 #else 230 230 //英語 231 231 sprintf(temporary,"%d : %d", 232 MdiInfo[WndNum].p mti->StartCaretPos.y+1,233 MdiInfo[WndNum].p mti->StartCaretPos.x+1);232 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1, 233 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1); 234 234 #endif 235 235 } … … 238 238 239 239 //文字コード 240 nkf.GetCharCodeName(MdiInfo[WndNum].p mti->iCharCode,temporary);240 nkf.GetCharCodeName(MdiInfo[WndNum].pMdiTextEdit->iCharCode,temporary); 241 241 SendMessage(hStatusBar,SB_SETTEXT,3,(LPARAM)temporary); 242 242 243 243 //文字コード 244 nkf.GetLfCodeName(MdiInfo[WndNum].p mti->iLfCode,temporary);244 nkf.GetLfCodeName(MdiInfo[WndNum].pMdiTextEdit->iLfCode,temporary); 245 245 SendMessage(hStatusBar,SB_SETTEXT,4,(LPARAM)temporary); 246 246 } … … 310 310 } 311 311 else if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){ 312 i2=MdiInfo[i]. edit_undo->NowPos-1;312 i2=MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos-1; 313 313 if(i2==-1) i2=MAX_UNDONUM-1; 314 if(!MdiInfo[i]. edit_undo->Command[i2]){314 if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[i2]){ 315 315 pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED); 316 316 EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED); … … 322 322 pobj_StandardToolbar->EnableItem(IDM_UNDO,1); 323 323 } 324 if(!MdiInfo[i]. edit_undo->Command[MdiInfo[i].edit_undo->NowPos]){324 if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos]){ 325 325 pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED); 326 326 EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED); … … 461 461 hChild=GetWindow(hChild,GW_CHILD); 462 462 if(!( 463 MdiInfo[WndNum].p mti->StartCaretPos.x==MdiInfo[WndNum].pmti->EndCaretPos.x&&464 MdiInfo[WndNum].p mti->StartCaretPos.y==MdiInfo[WndNum].pmti->EndCaretPos.y463 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&& 464 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y 465 465 )){ 466 466 MenuMsg=MF_BYCOMMAND|MF_ENABLED; … … 901 901 } 902 902 903 MdiInfo[i].pmti=(MDITEXTEDITINFO *)HeapAlloc(hHeap,0,sizeof(MDITEXTEDITINFO)); 904 905 MdiInfo[i].pmti->hEdit=hEdit; 906 MdiInfo[i].pmti->pobj_WebResult=new CWebResult(hChild); 907 MdiInfo[i].pmti->pobj_Ruler=new CRuler(hChild,i); 908 MdiInfo[i].pmti->hIcon=shfi.hIcon; 909 MdiInfo[i].pmti->buffer=buffer; 910 MdiInfo[i].pmti->pColorRef=(COLORREF *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(COLORREF)*lstrlen(buffer)); 911 MdiInfo[i].pmti->iUnderStart=-1; 912 MdiInfo[i].pmti->iUnderEnd=-1; 913 MdiInfo[i].pmti->StartCaretPos.x=0; 914 MdiInfo[i].pmti->StartCaretPos.y=0; 915 MdiInfo[i].pmti->EndCaretPos.x=0; 916 MdiInfo[i].pmti->EndCaretPos.y=0; 917 MdiInfo[i].pmti->Temp_UpDown_CaretXPos=-1; 918 MdiInfo[i].pmti->bAutoScroll=0; 919 MdiInfo[i].pmti->iWidth_ControlTabSpace= 920 GetControlTabSpace(i,&MdiInfo[i].pmti->iLineNumberTextCount); 921 MdiInfo[i].pmti->iCharCode=iCharCode; 922 MdiInfo[i].pmti->iLfCode=iLfCode; 923 MdiInfo[i].pmti->bModify=0; 903 MdiInfo[i].pMdiTextEdit = new CMdiTextEdit( &MdiInfo[i] ); 904 905 MdiInfo[i].pMdiTextEdit->hEdit=hEdit; 906 MdiInfo[i].pMdiTextEdit->pobj_WebResult=new CWebResult(hChild); 907 MdiInfo[i].pMdiTextEdit->pobj_Ruler=new CRuler(hChild,i); 908 MdiInfo[i].pMdiTextEdit->hIcon=shfi.hIcon; 909 MdiInfo[i].pMdiTextEdit->buffer=buffer; 910 MdiInfo[i].pMdiTextEdit->pColorRef=(COLORREF *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(COLORREF)*lstrlen(buffer)); 911 MdiInfo[i].pMdiTextEdit->iUnderStart=-1; 912 MdiInfo[i].pMdiTextEdit->iUnderEnd=-1; 913 MdiInfo[i].pMdiTextEdit->StartCaretPos.x=0; 914 MdiInfo[i].pMdiTextEdit->StartCaretPos.y=0; 915 MdiInfo[i].pMdiTextEdit->EndCaretPos.x=0; 916 MdiInfo[i].pMdiTextEdit->EndCaretPos.y=0; 917 MdiInfo[i].pMdiTextEdit->Temp_UpDown_CaretXPos=-1; 918 MdiInfo[i].pMdiTextEdit->bAutoScroll=0; 919 MdiInfo[i].pMdiTextEdit->iWidth_ControlTabSpace= 920 GetControlTabSpace(i,&MdiInfo[i].pMdiTextEdit->iLineNumberTextCount); 921 MdiInfo[i].pMdiTextEdit->iCharCode=iCharCode; 922 MdiInfo[i].pMdiTextEdit->iLfCode=iLfCode; 924 923 925 924 MdiInfo[i].IndentStr=0; 926 927 MdiInfo[i].edit_undo=(TEXTEDIT_UNDOSTATE *)GlobalAlloc(GPTR,sizeof(TEXTEDIT_UNDOSTATE));928 MdiInfo[i].edit_undo->NowPos=0;929 925 930 926 int flag; … … 945 941 946 942 //タブに追加 947 pobj_MainTab-> insert(str,1,TabColor);943 pobj_MainTab->InsertItem( str, true, TabColor ); 948 944 949 945 SetFocus(hEdit); … … 1018 1014 1019 1015 //タブコントロールからアイテムを消去 1020 if(pobj_MainTab) pobj_MainTab-> delete_item(MdiInfo[WndNum].title,1);1016 if(pobj_MainTab) pobj_MainTab->DeleteItem( MdiInfo[WndNum].title, true ); 1021 1017 1022 1018 … … 1036 1032 } 1037 1033 1038 for(i2=0;i2<MAX_UNDONUM;i2++){ 1039 if(MdiInfo[WndNum].edit_undo->Command[i2]) 1040 TextEdit_DeleteUndoData(WndNum,i2); 1041 } 1042 GlobalFree(MdiInfo[WndNum].edit_undo); 1043 1044 HeapDefaultFree(MdiInfo[WndNum].pmti->buffer); 1045 HeapDefaultFree(MdiInfo[WndNum].pmti->pColorRef); 1034 HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->buffer); 1035 HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->pColorRef); 1046 1036 1047 1037 if(MdiInfo[WndNum].IndentStr) HeapDefaultFree(MdiInfo[WndNum].IndentStr); 1048 1038 1049 1039 //エディットコントロールを破棄 1050 DestroyWindow(MdiInfo[WndNum].p mti->hEdit);1040 DestroyWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit); 1051 1041 1052 1042 //Web検索ウィンドウを破棄 1053 delete MdiInfo[WndNum].p mti->pobj_WebResult;1054 MdiInfo[WndNum].p mti->pobj_WebResult=0;1043 delete MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult; 1044 MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult=0; 1055 1045 1056 1046 //ルーラーウィンドウを破棄 1057 delete MdiInfo[WndNum].p mti->pobj_Ruler;1058 MdiInfo[WndNum].p mti->pobj_Ruler=0;1047 delete MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler; 1048 MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler=0; 1059 1049 1060 1050 //アイコンを破棄 1061 if(MdiInfo[WndNum].p mti->hIcon) DestroyIcon(MdiInfo[WndNum].pmti->hIcon);1062 1063 HeapDefaultFree(MdiInfo[WndNum].pmti);1064 MdiInfo[WndNum].p mti=0;1051 if(MdiInfo[WndNum].pMdiTextEdit->hIcon) DestroyIcon(MdiInfo[WndNum].pMdiTextEdit->hIcon); 1052 1053 delete MdiInfo[WndNum].pMdiTextEdit; 1054 MdiInfo[WndNum].pMdiTextEdit=0; 1065 1055 } 1066 1056 else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){ … … 1122 1112 if(pobj_nv->bEditor_Ruler){ 1123 1113 //ルーラー 1124 MdiInfo[WndNum].p mti->pobj_Ruler->resize(1114 MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->resize( 1125 1115 0, 1126 1116 0, … … 1130 1120 iHeightRuler=HEIGHT_RULER; 1131 1121 1132 ShowWindow(MdiInfo[WndNum].p mti->pobj_Ruler->hRulerWnd,SW_SHOW);1122 ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_SHOW); 1133 1123 } 1134 1124 else{ 1135 1125 iHeightRuler=0; 1136 1126 1137 ShowWindow(MdiInfo[WndNum].p mti->pobj_Ruler->hRulerWnd,SW_HIDE);1127 ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_HIDE); 1138 1128 } 1139 1129 1140 1130 //エディットウィンドウ 1141 MoveWindow(MdiInfo[WndNum].p mti->hEdit,1131 MoveWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit, 1142 1132 0, 1143 1133 iHeightRuler, … … 1147 1137 1148 1138 //Web検索ウィンドウ 1149 MdiInfo[WndNum].p mti->pobj_WebResult->resize(1139 MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->resize( 1150 1140 0, 1151 1141 cy-WebResultWndHeight, … … 1687 1677 hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,CharRange.cpMax-CharRange.cpMin+1); 1688 1678 pTemp=(char *)GlobalLock(hGlobal); 1689 memcpy(pTemp,MdiInfo[WndNum].p mti->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin);1679 memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin); 1690 1680 pTemp[CharRange.cpMax-CharRange.cpMin]=0; 1691 1681 GlobalUnlock(hGlobal); … … 1743 1733 hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,CharRange.cpMax-CharRange.cpMin+1); 1744 1734 pTemp=(char *)GlobalLock(hGlobal); 1745 memcpy(pTemp,MdiInfo[WndNum].p mti->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin);1735 memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin); 1746 1736 pTemp[CharRange.cpMax-CharRange.cpMin]=0; 1747 1737 GlobalUnlock(hGlobal); … … 1853 1843 hEdit=GetWindow(hChild,GW_CHILD); 1854 1844 1855 MdiInfo[WndNum].p mti->StartCaretPos.x=0;1856 MdiInfo[WndNum].p mti->StartCaretPos.y=0;1845 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0; 1846 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y=0; 1857 1847 1858 1848 GetCaretPosFromBufferIndex( 1859 MdiInfo[WndNum].p mti->buffer,1860 lstrlen(MdiInfo[WndNum].p mti->buffer),1861 &MdiInfo[WndNum].p mti->EndCaretPos);1849 MdiInfo[WndNum].pMdiTextEdit->buffer, 1850 lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer), 1851 &MdiInfo[WndNum].pMdiTextEdit->EndCaretPos); 1862 1852 1863 1853 InvalidateRect(hEdit,NULL,0); … … 2443 2433 2444 2434 //閉じる 2445 MdiInfo[WndNum].p mti->bModify=0;2435 MdiInfo[WndNum].pMdiTextEdit->UnModify(); 2446 2436 SendMessage(MdiInfo[WndNum].hwnd,WM_CLOSE,0,0); 2447 2437 … … 2552 2542 UpdateWindow(hChild); 2553 2543 2554 pTemp=MdiInfo[WndNum].p mti->buffer;2544 pTemp=MdiInfo[WndNum].pMdiTextEdit->buffer; 2555 2545 2556 2546 //行の先頭インデックスを取得(取得する行の番号はwParamで渡される)
Note:
See TracChangeset
for help on using the changeset viewer.