Changeset 24 in dev for ProjectEditor/TextEditor_MouseEvent.cpp
- Timestamp:
- Dec 30, 2006, 10:18:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/TextEditor_MouseEvent.cpp
r3 r24 10 10 if((GetKeyState(VK_CONTROL)&0x8000)&&pobj_nv->bCtrlKeyHyperLink){ 11 11 //Ctrlキーが押されているとき 12 if(MdiInfo[WndNum].p mti->iUnderStart!=-1){12 if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){ 13 13 //単語が選択可能なとき 14 14 15 15 //半角文字列を選択時の全角とのズレを修正 16 16 int start,end; 17 start=MdiInfo[WndNum].p mti->iUnderStart;18 end=MdiInfo[WndNum].p mti->iUnderEnd;19 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,start,&pos);20 start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].p mti->buffer,pos.x,pos.y);21 GetCaretPosFromBufferIndex(MdiInfo[WndNum].p mti->buffer,end,&pos);22 end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].p mti->buffer,pos.x,pos.y);17 start=MdiInfo[WndNum].pMdiTextEdit->iUnderStart; 18 end=MdiInfo[WndNum].pMdiTextEdit->iUnderEnd; 19 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,start,&pos); 20 start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y); 21 GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,end,&pos); 22 end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y); 23 23 24 24 int length; … … 30 30 memcpy( 31 31 pTemp, 32 MdiInfo[WndNum].p mti->buffer+start,32 MdiInfo[WndNum].pMdiTextEdit->buffer+start, 33 33 length); 34 34 pTemp[length]=0; … … 51 51 52 52 int iControlTabSpace; 53 iControlTabSpace=MdiInfo[WndNum].p mti->iWidth_ControlTabSpace;53 iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace; 54 54 55 55 if(MdiInfo[WndNum].IndentStr){ … … 58 58 } 59 59 60 MdiInfo[WndNum].p mti->bAutoScroll=0;60 MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0; 61 61 62 62 //上下キャレット移動時の左右位置保持機能を解除 63 MdiInfo[WndNum].p mti->Temp_UpDown_CaretXPos=-1;63 MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1; 64 64 65 65 if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){ … … 72 72 0, 73 73 pMousePos->y, 74 &MdiInfo[WndNum].p mti->StartCaretPos);75 MdiInfo[WndNum].p mti->EndCaretPos=MdiInfo[WndNum].pmti->StartCaretPos;74 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 75 MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos; 76 76 77 77 //////////// … … 80 80 81 81 char *pBuf; 82 pBuf=MdiInfo[WndNum].p mti->buffer;82 pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer; 83 83 CHARRANGE CharRange; 84 84 TextEdit_GetSel(WndNum,&CharRange); … … 99 99 pMousePos->x-iControlTabSpace, 100 100 pMousePos->y, 101 &MdiInfo[WndNum].p mti->StartCaretPos);101 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 102 102 103 103 if(!(GetKeyState(VK_SHIFT)&0x8000)){ 104 104 //シフトキーが押されていない、通常時 105 MdiInfo[WndNum].p mti->EndCaretPos=MdiInfo[WndNum].pmti->StartCaretPos;105 MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos; 106 106 } 107 107 … … 121 121 122 122 int iControlTabSpace; 123 iControlTabSpace=MdiInfo[WndNum].p mti->iWidth_ControlTabSpace;123 iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace; 124 124 125 125 if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){ … … 138 138 139 139 //オートスクロールスレッドを停止 140 MdiInfo[WndNum].p mti->bAutoScroll=0;140 MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0; 141 141 142 142 //編集メニューをリセット … … 159 159 //エディタ画面左端のコントロールタブ 160 160 int iControlTabSpace; 161 iControlTabSpace=MdiInfo[WndNum].p mti->iWidth_ControlTabSpace;162 163 164 while(MdiInfo[WndNum].p mti->bAutoScroll){161 iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace; 162 163 164 while(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){ 165 165 GetCursorPos(&pos); 166 166 ScreenToClient(hwnd,&pos); … … 175 175 pos.x, 176 176 pos.y, 177 &MdiInfo[WndNum].p mti->StartCaretPos);177 &MdiInfo[WndNum].pMdiTextEdit->StartCaretPos); 178 178 179 179 if(!TextEdit_ScrollCaret(WndNum,1)) … … 194 194 195 195 int iControlTabSpace; 196 iControlTabSpace=MdiInfo[WndNum].p mti->iWidth_ControlTabSpace;196 iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace; 197 197 198 198 if(GetCapture()==hwnd){ … … 214 214 //////////////////////////// 215 215 216 if(MdiInfo[WndNum].p mti->bAutoScroll){216 if(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){ 217 217 //すでにオートスクロールスレッドが作動中のときは抜け出す 218 218 return; … … 220 220 221 221 //オートスクロールスレッドを起動 222 MdiInfo[WndNum].p mti->bAutoScroll=1;222 MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=1; 223 223 224 224 _beginthread((void (__cdecl *)(void *))AutoScrollThread,0,(void *)hwnd); … … 226 226 return; 227 227 } 228 else if(MdiInfo[WndNum].p mti->bAutoScroll){228 else if(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){ 229 229 //オートスクロールを解除 230 MdiInfo[WndNum].p mti->bAutoScroll=0;230 MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0; 231 231 } 232 232 … … 242 242 &pos); 243 243 244 if(pos.x!=MdiInfo[WndNum].p mti->StartCaretPos.x||pos.y!=MdiInfo[WndNum].pmti->StartCaretPos.y){245 MdiInfo[WndNum].p mti->StartCaretPos=pos;244 if(pos.x!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x||pos.y!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y){ 245 MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=pos; 246 246 247 247 InvalidateRect(hwnd,NULL,0); … … 270 270 271 271 TextEdit_GetWordCaret( 272 MdiInfo[WndNum].p mti->hEdit,272 MdiInfo[WndNum].pMdiTextEdit->hEdit, 273 273 WndNum, 274 274 &pos, 275 &MdiInfo[WndNum].p mti->iUnderStart,&MdiInfo[WndNum].pmti->iUnderEnd,275 &MdiInfo[WndNum].pMdiTextEdit->iUnderStart,&MdiInfo[WndNum].pMdiTextEdit->iUnderEnd, 276 276 WORDCARET_AFTER); 277 277 … … 282 282 } 283 283 else{ 284 if(MdiInfo[WndNum].p mti->iUnderStart!=-1){285 MdiInfo[WndNum].p mti->iUnderStart=-1;286 MdiInfo[WndNum].p mti->iUnderEnd=-1;284 if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){ 285 MdiInfo[WndNum].pMdiTextEdit->iUnderStart=-1; 286 MdiInfo[WndNum].pMdiTextEdit->iUnderEnd=-1; 287 287 288 288 InvalidateRect(hwnd,NULL,0); … … 300 300 301 301 int start,end; 302 TextEdit_GetWordCaret(hwnd,WndNum,&MdiInfo[WndNum].p mti->StartCaretPos,&start,&end,WORDCARET_AFTER);302 TextEdit_GetWordCaret(hwnd,WndNum,&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos,&start,&end,WORDCARET_AFTER); 303 303 304 304 //セレクト … … 314 314 315 315 int iControlTabSpace; 316 iControlTabSpace=MdiInfo[WndNum].p mti->iWidth_ControlTabSpace;316 iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace; 317 317 318 318 if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){
Note:
See TracChangeset
for help on using the changeset viewer.