Changeset 786 in dev for branches/egtra/ab5.0/abdev
- Timestamp:
- Jan 30, 2011, 12:58:28 AM (14 years ago)
- Location:
- branches/egtra/ab5.0/abdev
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/abdev-impl/Resource/Load.cpp
r782 r786 1 1 #include "stdafx.h" 2 #include <map> 3 #include <tuple> 4 #include <Resource/Load.h> 2 5 3 6 namespace ActiveBasic { namespace Resource { 4 7 8 namespace { 9 10 template<typename Map, typename Key, typename AddValueFunctor> 11 typename Map::iterator GetCacheFromMap(Map& map, Key key, AddValueFunctor f) 12 { 13 auto low = map.lower_bound(key); 14 if (low != map.end() && map.key_comp()(key, low->first)) 15 { 16 return low; 17 } 18 else 19 { 20 typedef typename Map::key_type key_type; 21 typedef typename Map::value_type value_type; 22 return map.insert(low, std::make_pair(std::move(key), f())); 23 } 24 } 25 26 HICON LoadIconCursorImpl(HINSTANCE hinst, USHORT id, int cxDesired, int cyDesired, UINT load, bool isIcon) 27 { 28 auto hrsrc = FindResource(hinst, MAKEINTRESOURCE(id), isIcon ? RT_GROUP_ICON : RT_GROUP_CURSOR); 29 auto pResource = LockResource(LoadResource(hinst, hrsrc)); 30 31 auto idIcon = LookupIconIdFromDirectoryEx(reinterpret_cast<PBYTE>(pResource), isIcon, cxDesired, cyDesired, load); 32 auto hrsrcIcon = FindResource(hinst, MAKEINTRESOURCE(idIcon), isIcon ? RT_ICON : RT_CURSOR); 33 auto pResourceIcon = LockResource(LoadResource(hinst, hrsrcIcon)); 34 35 return CreateIconFromResourceEx(reinterpret_cast<PBYTE>(pResourceIcon), 36 SizeofResource(hinst, hrsrcIcon), isIcon, 0x00030000, cxDesired, cyDesired, load); 37 } 38 39 } 40 5 41 HICON LoadIcon(HINSTANCE hinst, USHORT id, int cxDesired, int cyDesired, UINT load) 6 42 { 7 auto hrsrc = FindResource(hinst, MAKEINTRESOURCE(id), RT_GROUP_ICON); 8 auto hMem = LoadResource(hinst, hrsrc); 9 auto pResource = LockResource(hMem); 43 return LoadIconCursorImpl(hinst, id, cxDesired, cyDesired, load, true); 44 } 10 45 11 auto idIcon = LookupIconIdFromDirectoryEx(reinterpret_cast<PBYTE>(pResource), TRUE, cxDesired, cyDesired, load); 12 auto hrsrcIcon = FindResource(hinst, MAKEINTRESOURCE(idIcon), MAKEINTRESOURCE(RT_ICON)); 13 auto hIconMem = LoadResource(hinst, hrsrcIcon);14 auto pResourceIcon = LockResource(hIconMem); 46 HICON LoadIcon(HINSTANCE hinst, USHORT id) 47 { 48 return LoadIconCursorImpl(hinst, id, 32, 32, LR_SHARED, true); 49 } 15 50 16 return CreateIconFromResourceEx(reinterpret_cast<PBYTE>(pResourceIcon), 17 SizeofResource(hinst, hrsrcIcon), TRUE, 0x00030000, cxDesired, cyDesired, load); 51 HCURSOR LoadCursor(HINSTANCE hinst, USHORT id) 52 { 53 return LoadIconCursorImpl(hinst, id, 32, 32, LR_SHARED, false); 18 54 } 19 55 -
branches/egtra/ab5.0/abdev/abdev-impl/Resource/Load.h
r784 r786 7 7 8 8 HICON LoadIcon(HINSTANCE hinst, USHORT id, int cxDesired, int cyDesired, UINT load = 0); 9 HICON LoadIcon(HINSTANCE hinst, USHORT id); 10 11 HCURSOR LoadCursor(HINSTANCE hinst, USHORT id); 9 12 10 13 struct IconDeleter -
branches/egtra/ab5.0/abdev/abdev/Complement.cpp
r655 r786 754 754 hImageList=ImageList_Create(16, 16, ILC_COLOR24, 7, 0); 755 755 ListView_SetImageList(hListView, hImageList, LVSIL_SMALL); 756 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_VARIABLE)));757 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_VARIABLE)));758 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_FUNCTION)));759 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_FUNCTION)));760 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_PAIRSTATEMENT)));761 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_HTML_GENERAL_PARAMETER)));762 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_HTML_PARAMETER)));756 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PRIVATE_VARIABLE)); 757 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PUBLIC_VARIABLE)); 758 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PRIVATE_FUNCTION)); 759 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PUBLIC_FUNCTION)); 760 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_PAIRSTATEMENT)); 761 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_HTML_GENERAL_PARAMETER)); 762 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_HTML_PARAMETER)); 763 763 764 764 return 0; -
branches/egtra/ab5.0/abdev/abdev/DialogBoxes.cpp
r763 r786 630 630 ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_FILE_BAS))); 631 631 ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_FILE_SBP))); 632 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_PJ)));633 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_TEXT)));634 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_HTML)));635 ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_ICON)));632 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_NEWFILE_PJ)); 633 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_NEWFILE_TEXT)); 634 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_NEWFILE_HTML)); 635 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_NEWFILE_ICON)); 636 636 637 637 -
branches/egtra/ab5.0/abdev/abdev/FileTree.cpp
r705 r786 160 160 //イメージリスト読み込み、設定 161 161 hImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,3,0); 162 ImageList_AddIcon(hImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));163 ImageList_AddIcon(hImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));164 ImageList_AddIcon(hImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT)));162 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_CLOSE)); 163 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_OPEN)); 164 ImageList_AddIcon(hImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_TEXTDOCUMENT)); 165 165 this->SetImageList(hImageList,TVSIL_NORMAL); 166 166 } -
branches/egtra/ab5.0/abdev/abdev/IconEditor_Main.cpp
r629 r786 1199 1199 InvalidateRect(hwnd,NULL,0); 1200 1200 1201 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_PEN)));1201 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_PEN)); 1202 1202 } 1203 1203 else if(MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_FILL){ … … 1214 1214 InvalidateRect(hwnd,NULL,0); 1215 1215 } 1216 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_FILL)));1216 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_FILL)); 1217 1217 } 1218 1218 else if(MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_LINE|| … … 1496 1496 } 1497 1497 else if(MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_PEN) 1498 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_PEN)));1498 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_PEN)); 1499 1499 else if(MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_FILL) 1500 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_FILL)));1500 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_FILL)); 1501 1501 else if(MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_LINE|| 1502 1502 MdiInfo[WndNum]->MdiIconEditInfo->NowTool==IDC_TOOL_RECTANGLE|| -
branches/egtra/ab5.0/abdev/abdev/Print.cpp
r763 r786 421 421 //拡大・縮小アイコンを表示 422 422 SendDlgItemMessage(hwnd,IDC_ZOOMOUT,BM_SETIMAGE,IMAGE_ICON , 423 (LPARAM)LoadImage(hResInst,MAKEINTRESOURCE(IDI_ZOOMOUT),IMAGE_ICON,16,16,LR_SHARED));423 reinterpret_cast<LPARAM>(ActiveBasic::Resource::LoadIcon(hResInst, IDI_ZOOMOUT, 16, 16, LR_SHARED))); 424 424 SendDlgItemMessage(hwnd,IDC_ZOOMIN,BM_SETIMAGE,IMAGE_ICON , 425 (LPARAM)LoadImage(hResInst,MAKEINTRESOURCE(IDI_ZOOMIN),IMAGE_ICON,16,16,LR_SHARED));425 reinterpret_cast<LPARAM>(ActiveBasic::Resource::LoadIcon(hResInst, IDI_ZOOMIN, 16, 16, LR_SHARED))); 426 426 iZoomNowPage=ZOOM_INIT; 427 427 -
branches/egtra/ab5.0/abdev/abdev/ProjectControl.cpp
r705 r786 466 466 //イメージリスト読み込み、設定 467 467 hProcedureTreeViewImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,8,0); 468 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));469 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));470 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_PROCEDURE)));471 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_PROGRAM_FOLDER)));472 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_VARIABLE)));473 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_FUNCTION)));474 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_VARIABLE)));475 ImageList_AddIcon(hProcedureTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_FUNCTION)));468 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_CLOSE)); 469 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_OPEN)); 470 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_PROCEDURE)); 471 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_PROGRAM_FOLDER)); 472 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PUBLIC_VARIABLE)); 473 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PUBLIC_FUNCTION)); 474 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PRIVATE_VARIABLE)); 475 ImageList_AddIcon(hProcedureTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MEMBER_PRIVATE_FUNCTION)); 476 476 TreeView_SetImageList(hProcedureTreeView,hProcedureTreeViewImageList,TVSIL_NORMAL); 477 477 … … 485 485 //イメージリスト読み込み、設定 486 486 hMaterialTreeViewImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,3,0); 487 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));488 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));489 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_WINDOW)));490 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MENU)));491 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_ICON)));492 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_BMP)));493 ImageList_AddIcon(hMaterialTreeViewImageList, LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_CURSOR)));487 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_CLOSE)); 488 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FOLDER_OPEN)); 489 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_WINDOW)); 490 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_MENU)); 491 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FILE_ICON)); 492 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FILE_BMP)); 493 ImageList_AddIcon(hMaterialTreeViewImageList, ActiveBasic::Resource::LoadIcon(hResInst, IDI_FILE_CURSOR)); 494 494 TreeView_SetImageList(hMaterialTreeView,hMaterialTreeViewImageList,TVSIL_NORMAL); 495 495 -
branches/egtra/ab5.0/abdev/abdev/SubOperation.cpp
r784 r786 838 838 extern HICON hOwnerIcon,hBasicProgramIcon,hTextDocumentIcon,hWindowDocumentIcon; 839 839 hOwnerIcon=(HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_MAIN),IMAGE_ICON,16,16,LR_DEFAULTCOLOR); 840 hBasicProgramIcon= (HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_BASICPROGRAM),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);841 hTextDocumentIcon= (HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);842 hWindowDocumentIcon= (HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_WINDOW),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);840 hBasicProgramIcon=ActiveBasic::Resource::LoadIcon(hResInst, IDI_BASICPROGRAM, 16, 16, LR_DEFAULTCOLOR); 841 hTextDocumentIcon=ActiveBasic::Resource::LoadIcon(hResInst,IDI_TEXTDOCUMENT,16,16,LR_DEFAULTCOLOR); 842 hWindowDocumentIcon=ActiveBasic::Resource::LoadIcon(hResInst,IDI_WINDOW,16,16,LR_DEFAULTCOLOR); 843 843 844 844 -
branches/egtra/ab5.0/abdev/abdev/TextEditor_MouseEvent.cpp
r629 r786 69 69 70 70 //カーソルを矢印マークにする 71 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));71 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_ARROW_TO_RIGHT)); 72 72 73 73 GetNaturalCaretPos_Click(WndNum, … … 129 129 130 130 //カーソルを矢印マークにする 131 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));131 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_ARROW_TO_RIGHT)); 132 132 } 133 133 … … 255 255 256 256 //カーソルを矢印マークにする 257 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));257 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_ARROW_TO_RIGHT)); 258 258 259 259 return; … … 321 321 322 322 //カーソルを矢印マーク(デフォルト)にする 323 SetCursor( LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));323 SetCursor(ActiveBasic::Resource::LoadCursor(hResInst, IDC_CURSOR_ARROW_TO_RIGHT)); 324 324 325 325 return; -
branches/egtra/ab5.0/abdev/abdev/abdev.cpp
r780 r786 914 914 SHFILEINFO shfi; 915 915 if(filepath) 916 { 916 917 SHGetFileInfo(filepath, FILE_ATTRIBUTE_ARCHIVE, &shfi, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON ); 917 else shfi.hIcon=(HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);; 918 } 919 else 920 { 921 shfi.hIcon = ActiveBasic::Resource::LoadIcon(hResInst, IDI_TEXTDOCUMENT, 16, 16, LR_DEFAULTCOLOR); 922 } 918 923 mdic.lParam=(LPARAM)shfi.hIcon; 919 924
Note:
See TracChangeset
for help on using the changeset viewer.