Changeset 1125 for trunk/dll/mainwnd.c
- Timestamp:
- Aug 27, 2008, 6:35:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r1121 r1125 107 107 static BOOL RestoreDirCnrState(HWND hwndClient, PSZ pszStateName, BOOL noview); 108 108 static VOID DeletePresParams(PSZ pszKeyroot); 109 static VOID BuildTools(HWND hwndT, BOOL resize); 109 110 110 111 static MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, … … 1291 1292 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ? 1292 1293 "TRUE" : NULL)) 1293 BuildTools(hwndToolback, TRUE);1294 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 1294 1295 break; 1295 1296 } … … 1410 1411 } 1411 1412 1412 VOID BuildTools(HWND hwndT, BOOL resize)1413 static VOID BuildTools(HWND hwndT, BOOL resize) 1413 1414 { 1414 1415 TOOL *tool; … … 1420 1421 henum = WinBeginEnumWindows(hwndT); 1421 1422 while ((hwndTool = WinGetNextWindow(henum)) != NULLHANDLE) 1422 WinDestroyWindow(hwndTool); 1423 if (!WinDestroyWindow(hwndTool)) 1424 Runtime_Error(pszSrcFile, __LINE__, "Unable to destroy toolbar button"); 1423 1425 WinEndEnumWindows(henum); 1424 1426 if (!fToolbar) { … … 2565 2567 return 0; 2566 2568 2569 case UM_SETUP2: /* Used to load a new a toolbar */ 2570 BuildTools(hwnd, TRUE); 2571 return 0; 2572 2567 2573 case WM_CHORD: 2568 2574 { … … 2584 2590 if (WinDlgBox(HWND_DESKTOP, 2585 2591 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID)) 2586 BuildTools(hwnd, TRUE);2592 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 2587 2593 return MRFROMSHORT(TRUE); 2588 2594 … … 2832 2838 fIsShutDownState = strcmp(pszStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0; 2833 2839 sprintf(szPrefix, "%s.", pszStateName); 2840 2841 sprintf(szKey, "%sToolbar", szPrefix); 2842 PrfWriteProfileString(fmprof, FM3Str, szKey, lasttoolbar); 2834 2843 2835 2844 henum = WinBeginEnumWindows(hwndClient); … … 3059 3068 fDeleteState = strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT)) == 0; 3060 3069 3070 size = (ULONG)0; 3071 sprintf(szKey, "%sToolbar", szPrefix); 3072 if (PrfQueryProfileSize(fmprof, FM3Str, szKey, &size) && size) 3073 { 3074 if (fToolsChanged) 3075 save_tools(NULL); 3076 PrfQueryProfileData(fmprof, FM3Str, szKey, lasttoolbar, &size); 3077 PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar); 3078 load_tools(NULL); 3079 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 3080 } 3061 3081 size = sizeof(SWP); 3062 3082 sprintf(szKey, "%sMySizeLastTime", szPrefix); … … 5107 5127 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5108 5128 &fTextTools, TRUE, "TextTools"); 5109 BuildTools(hwndToolback, TRUE);5129 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5110 5130 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5111 5131 MPFROMLONG(FCF_SIZEBORDER), MPVOID); … … 5115 5135 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5116 5136 &fToolTitles, TRUE, "ToolTitles"); 5117 BuildTools(hwndToolback, TRUE);5137 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5118 5138 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5119 5139 MPFROMLONG(FCF_SIZEBORDER), MPVOID); … … 5201 5221 5202 5222 case IDM_CREATETOOL: 5203 BuildTools(hwndToolback, TRUE);5223 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5204 5224 break; 5205 5225 … … 5207 5227 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5208 5228 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar"); 5209 BuildTools(hwndToolback, TRUE);5229 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5210 5230 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5211 5231 MAIN_TOOLS), fToolbar); … … 5398 5418 load_tools(NULL); 5399 5419 else { 5400 strcpy(lasttoolb ox,5420 strcpy(lasttoolbar, 5401 5421 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]); 5402 PrfWriteProfileString(fmprof, FM3Str, "LastTool Box", lasttoolbox);5422 PrfWriteProfileString(fmprof, FM3Str, "LastToolbar", lasttoolbar); 5403 5423 } 5404 BuildTools(hwndToolback, TRUE);5424 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5405 5425 } 5406 5426 } … … 5716 5736 * start up some initial children 5717 5737 */ 5718 load_tools(NULL);5719 BuildTools(hwndToolback, TRUE);5720 5738 WinShowWindow(WinQueryWindow(hwnd, QW_PARENT), TRUE); 5721 5739 PostMsg(MainObjectHwnd, UM_SETUP2, mp1, mp2); … … 5768 5786 SWP_ZORDER | SWP_ACTIVATE); 5769 5787 } 5770 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),5771 MAIN_TOOLS));5788 // ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5789 // MAIN_TOOLS)); 5772 5790 } 5773 5791 PostMsg(MainObjectHwnd, UM_SETUP3, mp1, mp2); … … 5780 5798 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszStatename), MPVOID); 5781 5799 if (!add_setup(pszStatename)) 5782 save_setups(); 5800 save_setups(); 5801 } else { 5802 load_tools(NULL); 5803 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 5783 5804 } 5784 5805 PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2); … … 6037 6058 if (!foundit) { 6038 6059 thisone = FALSE; 6039 p = strrchr(lasttoolb ox, '\\');6060 p = strrchr(lasttoolbar, '\\'); 6040 6061 if (!p) 6041 p = lasttoolb ox;6062 p = lasttoolbar; 6042 6063 else 6043 6064 p++; … … 6062 6083 priority_bumped(); 6063 6084 } 6064 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLB OXTEXT));6085 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBARTEXT)); 6065 6086 } 6066 6087 return 0; … … 6270 6291 load_tools(path); 6271 6292 PrfWriteProfileString(fmprof, 6272 FM3Str, "LastTool Box", lasttoolbox);6273 BuildTools(hwndToolback, TRUE);6274 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLB OXTEXT));6293 FM3Str, "LastToolbar", lasttoolbar); 6294 PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID); 6295 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBARTEXT)); 6275 6296 } 6276 6297 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) {
Note:
See TracChangeset
for help on using the changeset viewer.