static void hugsprim_ArrangeIconicWindows_19(HugsStackPtr hugs_root) { HsPtr arg1; HsBool res1; arg1 = hugs->getPtr(); res1 = ArrangeIconicWindows(arg1); hugs->putBool(res1); hugs->returnIO(hugs_root,1); }
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { #if 0 HLOCAL hActiveGroup = GROUP_ActiveGroup(); HLOCAL hActiveProgram = PROGRAM_ActiveProgram(hActiveGroup); HWND hActiveGroupWnd = GROUP_GroupWnd(hActiveGroup); switch(wParam) { /* Menu File */ case PM_NEW: switch (DIALOG_New((hActiveGroupWnd && !IsIconic(hActiveGroupWnd)) ? PM_NEW_PROGRAM : PM_NEW_GROUP)) { case PM_NEW_PROGRAM: if (hActiveGroup) PROGRAM_NewProgram(hActiveGroup); break; case PM_NEW_GROUP: GROUP_NewGroup(); break; } break; case PM_DELETE: if (hActiveProgram) { if (DIALOG_Delete(IDS_DELETE_PROGRAM_s, PROGRAM_ProgramName(hActiveProgram))) PROGRAM_DeleteProgram(hActiveProgram, TRUE); } else if (hActiveGroup) { if (DIALOG_Delete(IDS_DELETE_GROUP_s, GROUP_GroupName(hActiveGroup))) GROUP_DeleteGroup(hActiveGroup); } break; case PM_SAVE_SETTINGS: Globals.bSaveSettings = !Globals.bSaveSettings; CheckMenuItem(Globals.hOptionMenu, PM_SAVE_SETTINGS, MF_BYCOMMAND | (Globals.bSaveSettings ? MF_CHECKED : MF_UNCHECKED)); WritePrivateProfileStringA("Settings", "SaveSettings", Globals.bSaveSettings ? "1" : "0", Globals.lpszIniFile); WritePrivateProfileStringA(NULL,NULL,NULL,Globals.lpszIniFile); /* flush it */ break; case PM_ARRANGE: if (hActiveGroupWnd && !IsIconic(hActiveGroupWnd)) ArrangeIconicWindows(hActiveGroupWnd); else SendMessageW(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0); break; } #endif DWORD Value; PROGGROUP* hActiveGroup; PROGRAM* hActiveProgram; HWND hActiveGroupWnd; hActiveGroup = GROUP_ActiveGroup(); hActiveProgram = PROGRAM_ActiveProgram(hActiveGroup); hActiveGroupWnd = (hActiveGroup ? hActiveGroup->hWnd : NULL); switch (wParam) { /* Menu File */ case PM_NEW: { BOOL Success; INT nResult; if (!hActiveGroupWnd || IsIconic(hActiveGroupWnd)) Success = DIALOG_New(PM_NEW_GROUP, &nResult); else Success = DIALOG_New(PM_NEW_PROGRAM, &nResult); if (!Success) break; if (nResult & 1) { GROUPFORMAT format; BOOL bIsCommonGroup; format = (nResult & 0xC) >> 2; bIsCommonGroup = (nResult & 2) != 0; GROUP_NewGroup(format, bIsCommonGroup); } else if (hActiveGroup) { PROGRAM_NewProgram(hActiveGroup); } break; }
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { HLOCAL hActiveGroup = GROUP_ActiveGroup(); HLOCAL hActiveProgram = PROGRAM_ActiveProgram(hActiveGroup); HWND hActiveGroupWnd = GROUP_GroupWnd(hActiveGroup); switch(wParam) { /* Menu File */ case PM_NEW: switch (DIALOG_New((hActiveGroupWnd && !IsIconic(hActiveGroupWnd)) ? PM_NEW_PROGRAM : PM_NEW_GROUP)) { case PM_NEW_PROGRAM: if (hActiveGroup) PROGRAM_NewProgram(hActiveGroup); break; case PM_NEW_GROUP: GROUP_NewGroup(); break; } break; case PM_OPEN: if (hActiveProgram) PROGRAM_ExecuteProgram(hActiveProgram); else if (hActiveGroupWnd) OpenIcon(hActiveGroupWnd); break; case PM_MOVE: case PM_COPY: if (hActiveProgram) PROGRAM_CopyMoveProgram(hActiveProgram, wParam == PM_MOVE); break; case PM_DELETE: if (hActiveProgram) { if (DIALOG_Delete(IDS_DELETE_PROGRAM_s, PROGRAM_ProgramName(hActiveProgram))) PROGRAM_DeleteProgram(hActiveProgram, TRUE); } else if (hActiveGroup) { if (DIALOG_Delete(IDS_DELETE_GROUP_s, GROUP_GroupName(hActiveGroup))) GROUP_DeleteGroup(hActiveGroup); } break; case PM_ATTRIBUTES: if (hActiveProgram) PROGRAM_ModifyProgram(hActiveProgram); else if (hActiveGroup) GROUP_ModifyGroup(hActiveGroup); break; case PM_EXECUTE: DIALOG_Execute(); break; case PM_EXIT: PostQuitMessage(0); break; /* Menu Options */ case PM_AUTO_ARRANGE: Globals.bAutoArrange = !Globals.bAutoArrange; CheckMenuItem(Globals.hOptionMenu, PM_AUTO_ARRANGE, MF_BYCOMMAND | (Globals.bAutoArrange ? MF_CHECKED : MF_UNCHECKED)); WritePrivateProfileString("Settings", "AutoArrange", Globals.bAutoArrange ? "1" : "0", Globals.lpszIniFile); WritePrivateProfileString(NULL,NULL,NULL,Globals.lpszIniFile); /* flush it */ break; case PM_MIN_ON_RUN: Globals.bMinOnRun = !Globals.bMinOnRun; CheckMenuItem(Globals.hOptionMenu, PM_MIN_ON_RUN, MF_BYCOMMAND | (Globals.bMinOnRun ? MF_CHECKED : MF_UNCHECKED)); WritePrivateProfileString("Settings", "MinOnRun", Globals.bMinOnRun ? "1" : "0", Globals.lpszIniFile); WritePrivateProfileString(NULL,NULL,NULL,Globals.lpszIniFile); /* flush it */ break; case PM_SAVE_SETTINGS: Globals.bSaveSettings = !Globals.bSaveSettings; CheckMenuItem(Globals.hOptionMenu, PM_SAVE_SETTINGS, MF_BYCOMMAND | (Globals.bSaveSettings ? MF_CHECKED : MF_UNCHECKED)); WritePrivateProfileString("Settings", "SaveSettings", Globals.bSaveSettings ? "1" : "0", Globals.lpszIniFile); WritePrivateProfileString(NULL,NULL,NULL,Globals.lpszIniFile); /* flush it */ break; /* Menu Windows */ case PM_ARRANGE: if (hActiveGroupWnd && !IsIconic(hActiveGroupWnd)) ArrangeIconicWindows(hActiveGroupWnd); else SendMessage(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0); break; /* Menu Help */ case PM_CONTENTS: if (!WinHelp(Globals.hMainWnd, "progman.hlp", HELP_INDEX, 0)) MAIN_MessageBoxIDS(IDS_WINHELP_ERROR, IDS_ERROR, MB_OK); break; case PM_HELPONHELP: if (!WinHelp(Globals.hMainWnd, "progman.hlp", HELP_HELPONHELP, 0)) MAIN_MessageBoxIDS(IDS_WINHELP_ERROR, IDS_ERROR, MB_OK); break; case PM_TUTORIAL: WinExec("wintutor.exe", SW_SHOWNORMAL); break; case PM_LICENSE: WineLicense(Globals.hMainWnd, Globals.lpszLanguage); break; case PM_NO_WARRANTY: WineWarranty(Globals.hMainWnd, Globals.lpszLanguage); break; case PM_ABOUT_WINE: ShellAbout(hWnd, "WINE", "Program Manager", 0); break; default: if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE) STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE); else MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK); break; } }