Changeset 24 in dev for ProjectEditor/Replace.cpp
- Timestamp:
- Dec 30, 2006, 10:18:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/Replace.cpp
r22 r24 8 8 CHARRANGE Range,cr2; 9 9 10 pBuf=MdiInfo[WndNum].p mti->buffer;10 pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer; 11 11 12 12 //行の先頭位置を取得 … … 30 30 //初期化(すべて黒色に戻す) 31 31 for(i=Range.cpMin;i<Range.cpMax;i++){ 32 MdiInfo[WndNum].p mti->pColorRef[i]=tci.rgbDefault;32 MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbDefault; 33 33 } 34 34 … … 59 59 if(bResult){ 60 60 for(i2=cr2.cpMin;i2<cr2.cpMax;i2++){ 61 MdiInfo[WndNum].p mti->pColorRef[i2]=tci.rgbStatement;61 MdiInfo[WndNum].pMdiTextEdit->pColorRef[i2]=tci.rgbStatement; 62 62 } 63 63 } … … 65 65 if(IsStr||pBuf[i]=='\"'&&IsStr==0){ 66 66 //文字列カラー(""で囲まれる範囲) 67 MdiInfo[WndNum].p mti->pColorRef[i]=tci.rgbString;67 MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbString; 68 68 } 69 69 if(pBuf[i]=='\0') break; … … 90 90 //バッファ長を取得 91 91 int length; 92 length=lstrlen(MdiInfo[WndNum].p mti->buffer);92 length=lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer); 93 93 94 94 int delta; … … 99 99 //////////////////// 100 100 101 MdiInfo[WndNum].p mti->buffer=(char *)HeapReAlloc(hHeap,101 MdiInfo[WndNum].pMdiTextEdit->buffer=(char *)HeapReAlloc(hHeap, 102 102 0, 103 MdiInfo[WndNum].p mti->buffer,103 MdiInfo[WndNum].pMdiTextEdit->buffer, 104 104 length+1+delta); 105 105 106 MdiInfo[WndNum].p mti->pColorRef=(COLORREF *)HeapReAlloc(hHeap,106 MdiInfo[WndNum].pMdiTextEdit->pColorRef=(COLORREF *)HeapReAlloc(hHeap, 107 107 0, 108 MdiInfo[WndNum].p mti->pColorRef,108 MdiInfo[WndNum].pMdiTextEdit->pColorRef, 109 109 (length+1+delta)*sizeof(COLORREF)); 110 110 } … … 115 115 ProjectInfo.pobj_DBBreakPoint->replace( 116 116 MdiInfo[WndNum].path, 117 MdiInfo[WndNum].p mti->buffer,117 MdiInfo[WndNum].pMdiTextEdit->buffer, 118 118 &DelRange, 119 119 &Range, … … 124 124 pobj_DBBreakPoint->replace( 125 125 MdiInfo[WndNum].path, 126 MdiInfo[WndNum].p mti->buffer,126 MdiInfo[WndNum].pMdiTextEdit->buffer, 127 127 &DelRange, 128 128 &Range, … … 132 132 133 133 //文字列バッファをスライドして、挿入 134 SlideString(MdiInfo[WndNum].p mti->buffer+DelRange.cpMax,134 SlideString(MdiInfo[WndNum].pMdiTextEdit->buffer+DelRange.cpMax, 135 135 delta); 136 memcpy(MdiInfo[WndNum].p mti->buffer+Range.cpMin,str,lstrlen(str));136 memcpy(MdiInfo[WndNum].pMdiTextEdit->buffer+Range.cpMin,str,lstrlen(str)); 137 137 138 138 //文字カラーバッファをスライド 139 SlideBuffer(((char *)MdiInfo[WndNum].p mti->pColorRef)+DelRange.cpMax*sizeof(COLORREF),139 SlideBuffer(((char *)MdiInfo[WndNum].pMdiTextEdit->pColorRef)+DelRange.cpMax*sizeof(COLORREF), 140 140 (length-DelRange.cpMax) * sizeof(COLORREF), 141 141 delta*sizeof(COLORREF)); … … 144 144 145 145 //新しいキャレット位置に変更 146 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,146 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer, 147 147 Range.cpMax, 148 &MdiInfo[WndNum].p mti->StartCaretPos);149 MdiInfo[WndNum].p mti->EndCaretPos=MdiInfo[WndNum].pmti->StartCaretPos;148 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 149 MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos; 150 150 151 151 //コントロールタブスペースの幅と行番号の文字数を更新 152 MdiInfo[WndNum].p mti->iWidth_ControlTabSpace=153 GetControlTabSpace(WndNum,&MdiInfo[WndNum].p mti->iLineNumberTextCount);152 MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace= 153 GetControlTabSpace(WndNum,&MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount); 154 154 155 155 if(bRedraw){ … … 159 159 160 160 if(!TextEdit_ScrollCaret(WndNum,0)){ 161 UpdateWindow(MdiInfo[WndNum].p mti->hEdit); //ちらつき防止162 InvalidateRect(MdiInfo[WndNum].p mti->hEdit,NULL,0);161 UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit); //ちらつき防止 162 InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0); 163 163 } 164 164 … … 167 167 168 168 //上下キャレット移動時の左右位置保持機能を解除 169 MdiInfo[WndNum].p mti->Temp_UpDown_CaretXPos=-1;169 MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1; 170 170 171 171 //編集メニューをリセット 172 172 ResetState_EditMenu(); 173 173 174 //変更フラグをセット 175 MdiInfo[WndNum].pmti->bModify=1; 174 if( ! MdiInfo[WndNum].pMdiTextEdit->IsModified() ){ 175 //変更フラグをセット 176 MdiInfo[WndNum].pMdiTextEdit->Modify(); 177 } 176 178 177 179 … … 245 247 #endif 246 248 char *pBuf; 247 pBuf=MdiInfo[WndNum].p mti->buffer;249 pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer; 248 250 249 251 //行全体を選択(min) … … 270 272 buffer=(char *)HeapAlloc(hHeap,0,length*3+1024); 271 273 temporary=(char *)HeapAlloc(hHeap,0,length*3+1024); 272 memcpy(buffer,MdiInfo[WndNum].p mti->buffer+CharRange.cpMin,length);274 memcpy(buffer,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,length); 273 275 buffer[length]=0; 274 276
Note:
See TracChangeset
for help on using the changeset viewer.