Changeset 616 in dev for trunk/ab5.0/abdev/abdev/WindowControl.cpp
- Timestamp:
- May 19, 2008, 3:03:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/WindowControl.cpp
r615 r616 70 70 BYTE *pByte; 71 71 int i2,i3,MemSize; 72 CHILDINFO *pChildInfo;73 72 74 73 for(i3=0;;i3++){ … … 86 85 87 86 for(i3--;i3>=0;i3--){ 88 pChildInfo=&ProjectInfo.windowInfos[WndInfoNum]->pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]];87 CHILDINFO *pChildInfo = ProjectInfo.windowInfos[WndInfoNum]->childWindowInfos[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]]; 89 88 90 89 MemSize+=lstrlen(pChildInfo->IdName)+1+ … … 557 556 558 557 //子ウィンドウ作成 559 for(i2=0,sw=0;i2<pWindowInfo->NumberOfChildWindows;i2++){ 560 if(pWindowInfo->pChildInfo[i2].Control==CT_UPDOWN){ 558 sw = 0; 559 BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos ) 560 { 561 if(pChildInfo->Control==CT_UPDOWN){ 561 562 sprintf(Command+i,"%s\tCreateUpDownControl(%d,%d,%d,%d,%d,hWnd,%s,GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,0,0,100,0)\r\n", 562 563 spaces, 563 p WindowInfo->pChildInfo[i2].style,564 p WindowInfo->pChildInfo[i2].pos.x,pWindowInfo->pChildInfo[i2].pos.y,565 p WindowInfo->pChildInfo[i2].size.cx,pWindowInfo->pChildInfo[i2].size.cy,566 p WindowInfo->pChildInfo[i2].IdName);564 pChildInfo->style, 565 pChildInfo->pos.x,pChildInfo->pos.y, 566 pChildInfo->size.cx,pChildInfo->size.cy, 567 pChildInfo->IdName); 567 568 i+=lstrlen(Command+i); 568 569 } 569 570 else{ 570 GetItemClassName(temporary,p WindowInfo->pChildInfo[i2].Control);571 temp2=FormatCaption(p WindowInfo->pChildInfo[i2].caption);571 GetItemClassName(temporary,pChildInfo->Control); 572 temp2=FormatCaption(pChildInfo->caption); 572 573 sprintf(Command+i,"%s\tCreateWindowEx(&H%08x,\"%s\",\"%s\",&H%08x,%d,%d,%d,%d,hWnd,%s As HMENU,GetModuleHandle(0),0)\r\n", 573 574 spaces, 574 p WindowInfo->pChildInfo[i2].ExStyle,575 pChildInfo->ExStyle, 575 576 temporary, 576 577 temp2, 577 p WindowInfo->pChildInfo[i2].style,578 p WindowInfo->pChildInfo[i2].pos.x,579 p WindowInfo->pChildInfo[i2].pos.y,580 p WindowInfo->pChildInfo[i2].size.cx,581 p WindowInfo->pChildInfo[i2].size.cy,582 p WindowInfo->pChildInfo[i2].IdName);578 pChildInfo->style, 579 pChildInfo->pos.x, 580 pChildInfo->pos.y, 581 pChildInfo->size.cx, 582 pChildInfo->size.cy, 583 pChildInfo->IdName); 583 584 i+=lstrlen(Command+i); 584 585 HeapDefaultFree(temp2); 585 586 sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),WM_SETFONT,hFont_%s As WPARAM,0)\r\n", 586 587 spaces, 587 p WindowInfo->pChildInfo[i2].IdName,588 pChildInfo->IdName, 588 589 pWindowInfo->name); 589 590 i+=lstrlen(Command+i); 590 591 591 if(p WindowInfo->pChildInfo[i2].Control==CT_IMAGEBOX){592 if(pChildInfo->Control==CT_IMAGEBOX){ 592 593 //イメージ ボックスの場合 593 if((p WindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON){594 if(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE){595 if(strstr(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path,":")||596 strstr(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path,"\\\\")){594 if((pChildInfo->style&0x000F)==SS_ICON){ 595 if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_FILE){ 596 if(strstr(pChildInfo->ImageCtrlInfo.path,":")|| 597 strstr(pChildInfo->ImageCtrlInfo.path,"\\\\")){ 597 598 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n", 598 599 spaces, 599 600 pWindowInfo->name, 600 p WindowInfo->pChildInfo[i2].IdName,601 p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);601 pChildInfo->IdName, 602 pChildInfo->ImageCtrlInfo.path); 602 603 } 603 604 else{ … … 623 624 i+=2; 624 625 } 625 sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);626 sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->ImageCtrlInfo.path); 626 627 i+=lstrlen(Command+i); 627 628 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n", 628 629 spaces, 629 630 pWindowInfo->name, 630 p WindowInfo->pChildInfo[i2].IdName);631 pChildInfo->IdName); 631 632 } 632 633 i+=lstrlen(Command+i); 633 634 } 634 else if(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_RES){635 else if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_RES){ 635 636 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_ICON,0,0,LR_DEFAULTSIZE)\r\n", 636 637 spaces, 637 638 pWindowInfo->name, 638 p WindowInfo->pChildInfo[i2].IdName,639 p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);639 pChildInfo->IdName, 640 pChildInfo->ImageCtrlInfo.path); 640 641 i+=lstrlen(Command+i); 641 642 } 642 643 sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETICON,hImage_%s_%s As WPARAM,0)\r\n", 643 644 spaces, 644 p WindowInfo->pChildInfo[i2].IdName,645 pChildInfo->IdName, 645 646 pWindowInfo->name, 646 p WindowInfo->pChildInfo[i2].IdName);647 pChildInfo->IdName); 647 648 i+=lstrlen(Command+i); 648 649 } 649 else if((p WindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP){650 if(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE){651 if(strstr(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path,":")||652 strstr(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path,"\\\\")){650 else if((pChildInfo->style&0x000F)==SS_BITMAP){ 651 if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_FILE){ 652 if(strstr(pChildInfo->ImageCtrlInfo.path,":")|| 653 strstr(pChildInfo->ImageCtrlInfo.path,"\\\\")){ 653 654 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n", 654 655 spaces, 655 656 pWindowInfo->name, 656 p WindowInfo->pChildInfo[i2].IdName,657 p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);657 pChildInfo->IdName, 658 pChildInfo->ImageCtrlInfo.path); 658 659 } 659 660 else{ … … 679 680 i+=2; 680 681 } 681 sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);682 sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pChildInfo->ImageCtrlInfo.path); 682 683 i+=lstrlen(Command+i); 683 684 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE)\r\n", 684 685 spaces, 685 686 pWindowInfo->name, 686 p WindowInfo->pChildInfo[i2].IdName);687 pChildInfo->IdName); 687 688 } 688 689 i+=lstrlen(Command+i); 689 690 } 690 else if(p WindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_RES){691 else if(pChildInfo->ImageCtrlInfo.type==IMGTYPE_RES){ 691 692 sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE)\r\n", 692 693 spaces, 693 694 pWindowInfo->name, 694 p WindowInfo->pChildInfo[i2].IdName,695 p WindowInfo->pChildInfo[i2].ImageCtrlInfo.path);695 pChildInfo->IdName, 696 pChildInfo->ImageCtrlInfo.path); 696 697 i+=lstrlen(Command+i); 697 698 } 698 699 sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETIMAGE,IMAGE_BITMAP,hImage_%s_%s As LPARAM)\r\n", 699 700 spaces, 700 p WindowInfo->pChildInfo[i2].IdName,701 pChildInfo->IdName, 701 702 pWindowInfo->name, 702 p WindowInfo->pChildInfo[i2].IdName);703 pChildInfo->IdName); 703 704 i+=lstrlen(Command+i); 704 705 } … … 731 732 732 733 //イメージ ボックス用の変数を解放 733 for(i2=0;i2<pWindowInfo->NumberOfChildWindows;i2++){ 734 if(pWindowInfo->pChildInfo[i2].Control==CT_IMAGEBOX){ 735 if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON) 736 sprintf(Command+i,"%s\tDestroyIcon(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pWindowInfo->pChildInfo[i2].IdName); 737 else if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP) 738 sprintf(Command+i,"%s\tDeleteObject(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pWindowInfo->pChildInfo[i2].IdName); 734 BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos ) 735 { 736 if(pChildInfo->Control==CT_IMAGEBOX){ 737 if((pChildInfo->style&0x000F)==SS_ICON) 738 sprintf(Command+i,"%s\tDestroyIcon(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pChildInfo->IdName); 739 else if((pChildInfo->style&0x000F)==SS_BITMAP) 740 sprintf(Command+i,"%s\tDeleteObject(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pChildInfo->IdName); 739 741 i+=lstrlen(Command+i); 740 742 } … … 1005 1007 BOOST_FOREACH( WindowInfo *pWindowInfo, ProjectInfo.windowInfos ) 1006 1008 { 1007 for(i3=0;i3<pWindowInfo->NumberOfChildWindows;i3++){1008 1009 BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos ) 1010 { 1009 1011 //重複チェック 1010 1012 for(i6=0,sw1=0;i6<i5;i6++){ 1011 if(lstrcmpi(ppNames[i6],p WindowInfo->pChildInfo[i3].IdName)==0){1013 if(lstrcmpi(ppNames[i6],pChildInfo->IdName)==0){ 1012 1014 sw1=1; 1013 1015 break; … … 1017 1019 1018 1020 ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*(i5+1)); 1019 ppNames[i5]=p WindowInfo->pChildInfo[i3].IdName;1021 ppNames[i5]=pChildInfo->IdName; 1020 1022 i5++; 1021 1023 1022 sprintf(buffer+i2,"Const %s=%d\r\n",p WindowInfo->pChildInfo[i3].IdName,i4);1024 sprintf(buffer+i2,"Const %s=%d\r\n",pChildInfo->IdName,i4); 1023 1025 i2+=lstrlen(buffer+i2); 1024 1026 i4++; … … 1104 1106 BOOST_FOREACH( WindowInfo *pWindowInfo, ProjectInfo.windowInfos ) 1105 1107 { 1106 for(i3=0;i3<pWindowInfo->NumberOfChildWindows;i3++){ 1107 if(pWindowInfo->pChildInfo[i3].Control==CT_IMAGEBOX){ 1108 if((pWindowInfo->pChildInfo[i3].style&0x000F)==SS_ICON|| 1109 (pWindowInfo->pChildInfo[i3].style&0x000F)==SS_BITMAP){ 1110 sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",pWindowInfo->name,pWindowInfo->pChildInfo[i3].IdName); 1108 BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos ) 1109 { 1110 if(pChildInfo->Control==CT_IMAGEBOX){ 1111 if((pChildInfo->style&0x000F)==SS_ICON|| 1112 (pChildInfo->style&0x000F)==SS_BITMAP){ 1113 sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",pWindowInfo->name,pChildInfo->IdName); 1111 1114 i2+=lstrlen(buffer+i2); 1112 1115 … … 1627 1630 extern HANDLE hHeap; 1628 1631 extern MDIINFO MdiInfo[MAX_WNDNUM]; 1629 int i,i2, i3,size;1632 int i,i2,size; 1630 1633 char *buffer,*temporary; 1631 1634 … … 1685 1688 sprintf(buffer+i2," FILEPATH = %s\r\n",pWindowInfo->filepath); 1686 1689 i2+=lstrlen(buffer+i2); 1687 for(i3=0;i3<pWindowInfo->NumberOfChildWindows;i3++){ 1688 temporary=SetCaptionSequence(pWindowInfo->pChildInfo[i3].caption); 1690 BOOST_FOREACH( const CHILDINFO *pChildInfo, pWindowInfo->childWindowInfos ) 1691 { 1692 temporary=SetCaptionSequence(pChildInfo->caption); 1689 1693 sprintf(buffer+i2," ITEM = %s,%d,%d,%d,%d,\"%s\",&H%08x,&H%08x,%d", 1690 p WindowInfo->pChildInfo[i3].IdName,1691 p WindowInfo->pChildInfo[i3].pos.x,pWindowInfo->pChildInfo[i3].pos.y,1692 p WindowInfo->pChildInfo[i3].size.cx,pWindowInfo->pChildInfo[i3].size.cy,1694 pChildInfo->IdName, 1695 pChildInfo->pos.x,pChildInfo->pos.y, 1696 pChildInfo->size.cx,pChildInfo->size.cy, 1693 1697 temporary, 1694 p WindowInfo->pChildInfo[i3].style,1695 p WindowInfo->pChildInfo[i3].ExStyle,1696 p WindowInfo->pChildInfo[i3].Control1698 pChildInfo->style, 1699 pChildInfo->ExStyle, 1700 pChildInfo->Control 1697 1701 ); 1698 1702 i2+=lstrlen(buffer+i2); 1699 1703 HeapDefaultFree(temporary); 1700 if(p WindowInfo->pChildInfo[i3].Control==CT_IMAGEBOX){1701 sprintf(buffer+i2,",%d,\"%s\"",p WindowInfo->pChildInfo[i3].ImageCtrlInfo.type,pWindowInfo->pChildInfo[i3].ImageCtrlInfo.path);1704 if(pChildInfo->Control==CT_IMAGEBOX){ 1705 sprintf(buffer+i2,",%d,\"%s\"",pChildInfo->ImageCtrlInfo.type,pChildInfo->ImageCtrlInfo.path); 1702 1706 i2+=lstrlen(buffer+i2); 1703 1707 } … … 1829 1833 int i,i2,i3,i4,i5; 1830 1834 char *buffer,temporary[MAX_PATH],*temp2,temp3[MAX_PATH]; 1831 CHILDINFO *pChildInfo;1832 1835 1833 1836 buffer=ReadBuffer(path); … … 1881 1884 ProjectInfo.windowInfos.back()->name=(char *)HeapAlloc(hHeap,0,i2+1); 1882 1885 lstrcpy(ProjectInfo.windowInfos.back()->name,temp2); 1883 1884 ProjectInfo.windowInfos.back()->NumberOfChildWindows=0;1885 ProjectInfo.windowInfos.back()->pChildInfo=(CHILDINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);1886 1886 } 1887 1887 else if(lstrcmpi(temporary,"HANDLE")==0&&i3==1){ … … 1992 1992 } 1993 1993 else if(lstrcmpi(temporary,"ITEM")==0&&i3==1){ 1994 ProjectInfo.windowInfos.back()->pChildInfo=(CHILDINFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,ProjectInfo.windowInfos.back()->pChildInfo,(ProjectInfo.windowInfos.back()->NumberOfChildWindows+1)*sizeof(CHILDINFO)); 1995 pChildInfo=&ProjectInfo.windowInfos.back()->pChildInfo[ProjectInfo.windowInfos.back()->NumberOfChildWindows]; 1994 CHILDINFO *pChildInfo = new CHILDINFO(); 1996 1995 1997 1996 //ID … … 2039 2038 } 2040 2039 2041 ProjectInfo.windowInfos.back()-> NumberOfChildWindows++;2040 ProjectInfo.windowInfos.back()->childWindowInfos.push_back( pChildInfo ); 2042 2041 } 2043 2042 … … 2266 2265 ProjectInfo.windowInfos.back()->type=NewWindow.type; 2267 2266 2268 //子ウィンドウ情報2269 ProjectInfo.windowInfos.back()->NumberOfChildWindows=0;2270 ProjectInfo.windowInfos.back()->pChildInfo=(CHILDINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);2271 2272 2267 2273 2268 //メッセージ処理ファイル名 … … 2346 2341 2347 2342 //子ウィンドウのメモリを解放 2348 for(i=0;i<pWindowInfo->NumberOfChildWindows;i++){ 2349 HeapDefaultFree(pWindowInfo->pChildInfo[i].IdName); 2350 HeapDefaultFree(pWindowInfo->pChildInfo[i].caption); 2351 } 2352 HeapDefaultFree(pWindowInfo->pChildInfo); 2343 for(i=0;i<pWindowInfo->childWindowInfos.size();i++){ 2344 HeapDefaultFree(pWindowInfo->childWindowInfos[i]->IdName); 2345 HeapDefaultFree(pWindowInfo->childWindowInfos[i]->caption); 2346 delete pWindowInfo->childWindowInfos[i]; 2347 } 2348 pWindowInfo->childWindowInfos.clear(); 2353 2349 2354 2350 //ツリービューから削除
Note:
See TracChangeset
for help on using the changeset viewer.