Changeset 80 in dev for ProjectEditor/Search.cpp
- Timestamp:
- Mar 26, 2007, 6:33:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/Search.cpp
r24 r80 4 4 int FindPosCounter; 5 5 6 char *CompareSuper(HWND hDlg,char *buffer,char *szFind,BOOL IsBigSmall, BOOL IsRegExp,int *pLength){6 char *CompareSuper(HWND hDlg,char *buffer,char *szFind,BOOL IsBigSmall,bool isWordUnit,BOOL IsRegExp,int *pLength ){ 7 7 char *pTemp; 8 8 … … 11 11 if(IsRegExp){ 12 12 //正規表現を有効にしながら検索 13 pTemp=obj_RegExp.compare(hDlg,buffer,szFind,IsBigSmall, pLength);13 pTemp=obj_RegExp.compare(hDlg,buffer,szFind,IsBigSmall, isWordUnit, pLength); 14 14 } 15 15 else{ 16 16 //通常の検索 17 pTemp=ComparisonString(buffer,szFind,IsBigSmall );17 pTemp=ComparisonString(buffer,szFind,IsBigSmall?true:false, isWordUnit ); 18 18 19 19 *pLength=lstrlen(szFind); … … 23 23 } 24 24 25 void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall ){25 void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall, bool isWordUnit){ 26 26 extern HANDLE hHeap; 27 27 extern MDIINFO MdiInfo[MAX_WNDNUM]; … … 46 46 i3=1; 47 47 while(1){ 48 FindStr=CompareSuper(hDlg,buffer+i,str,IsBigSmall, pobj_nv->bRegExp,&length);48 FindStr=CompareSuper(hDlg,buffer+i,str,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length); 49 49 if(FindStr==(char *)-1){ 50 50 //エラー … … 136 136 return 0; 137 137 } 138 BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall, BOOL IsShowMessage){138 BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall, bool isWordUnit, BOOL IsShowMessage){ 139 139 extern MDIINFO MdiInfo[MAX_WNDNUM]; 140 140 int i; … … 155 155 int length; 156 156 157 i=(int)CompareSuper(hDlg,pBuf+i,FindString,IsBigSmall, pobj_nv->bRegExp,&length);157 i=(int)CompareSuper(hDlg,pBuf+i,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length); 158 158 if(i==-1){ 159 159 //エラー … … 173 173 if(!IsShowMessage) return 0; 174 174 175 i=(int)CompareSuper(hDlg,pBuf,FindString,IsBigSmall, pobj_nv->bRegExp,&length);175 i=(int)CompareSuper(hDlg,pBuf,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length); 176 176 if(i==-1){ 177 177 //エラー … … 223 223 //大文字・小文字 224 224 if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0); 225 226 // 単語単位 227 if( pobj_nv->isWordUnit ){ 228 SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 ); 229 } 225 230 226 231 //正規表現 … … 263 268 else pobj_nv->bFindStrBigSmall=0; 264 269 270 // 単語単位 271 pobj_nv->isWordUnit = 272 ( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 ); 273 265 274 //正規表現 266 275 if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1; 267 276 else pobj_nv->bRegExp=0; 268 277 269 StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, 1);278 StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1); 270 279 return 1; 271 280 case IDC_FINDALL: … … 278 287 else pobj_nv->bFindStrBigSmall=0; 279 288 289 // 単語単位 290 pobj_nv->isWordUnit = 291 ( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 ); 292 280 293 //正規表現 281 294 if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1; … … 287 300 FindPosCounter=sizeof(long); 288 301 pFindPos=(long *)HeapAlloc(hHeap,0,FindPosCounter); 289 SetSearchData(FindAllDlg,temporary,pobj_nv->bFindStrBigSmall );302 SetSearchData(FindAllDlg,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit ); 290 303 case IDCANCEL: 291 304 EndDialog(hwnd,0); … … 311 324 if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0); 312 325 326 // 単語単位 327 if( pobj_nv->isWordUnit ){ 328 SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 ); 329 } 330 313 331 //正規表現 314 332 if(pobj_nv->bRegExp) SendDlgItemMessage(hwnd,IDC_REGEXP,BM_SETCHECK,BST_CHECKED,0); … … 356 374 else pobj_nv->bFindStrBigSmall=0; 357 375 376 // 単語単位 377 pobj_nv->isWordUnit = 378 ( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 ); 379 358 380 //正規表現 359 381 if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1; … … 364 386 AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary); 365 387 366 StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, 1);388 StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1); 367 389 return 1; 368 390 case IDC_PERMUTATIONNEXT: … … 374 396 if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1; 375 397 else pobj_nv->bFindStrBigSmall=0; 398 399 // 単語単位 400 pobj_nv->isWordUnit = 401 ( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 ); 376 402 377 403 //正規表現 … … 399 425 400 426 int length; 401 i=(int)CompareSuper(hwnd,pTemp,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->bRegExp,&length);427 i=(int)CompareSuper(hwnd,pTemp,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, pobj_nv->bRegExp,&length); 402 428 if(i==-1){ 403 429 HeapDefaultFree(pTemp); … … 441 467 else pobj_nv->bFindStrBigSmall=0; 442 468 469 // 単語単位 470 pobj_nv->isWordUnit = 471 ( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 ); 472 443 473 //正規表現 444 474 if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1; … … 462 492 TextEdit_SetSel(WndNum,0,0,TRUE); 463 493 464 while(StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, 0)){494 while(StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 0)){ 465 495 if(pobj_nv->bRegExp){ 466 496 //選択されている文字列を取得
Note:
See TracChangeset
for help on using the changeset viewer.