4 * Copyright 1998 Marcel Baur <mbaur@g26.ethz.ch>
5 * Copyright 1998 Karl Backström <karl_b@geocities.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 CHAR STRING_MENU_Xx[] = "MENU_Xx";
30 VOID LANGUAGE_UpdateMenuCheckmarks(VOID)
32 if(Globals.bAnalog == TRUE) {
36 CheckMenuItem(Globals.hPropertiesMenu, 0x100,
37 MF_BYCOMMAND | MF_CHECKED);
38 CheckMenuItem(Globals.hPropertiesMenu, 0x101,
39 MF_BYCOMMAND | MF_UNCHECKED);
40 EnableMenuItem(Globals.hPropertiesMenu, 0x103,
41 MF_BYCOMMAND | MF_GRAYED);
47 CheckMenuItem(Globals.hPropertiesMenu, 0x100,
48 MF_BYCOMMAND | MF_UNCHECKED);
49 CheckMenuItem(Globals.hPropertiesMenu, 0x101,
50 MF_BYCOMMAND | MF_CHECKED);
51 EnableMenuItem(Globals.hPropertiesMenu, 0x103,
55 CheckMenuItem(Globals.hPropertiesMenu, 0x105, MF_BYCOMMAND |
56 (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED));
57 CheckMenuItem(Globals.hSystemMenu, 0x10D, MF_BYCOMMAND |
58 (Globals.bAlwaysOnTop ? MF_CHECKED : MF_UNCHECKED));
59 CheckMenuItem(Globals.hPropertiesMenu, 0x107, MF_BYCOMMAND |
60 (Globals.bSeconds ? MF_CHECKED : MF_UNCHECKED));
61 CheckMenuItem(Globals.hPropertiesMenu, 0x108, MF_BYCOMMAND |
62 (Globals.bDate ? MF_CHECKED : MF_UNCHECKED));
65 VOID LANGUAGE_UpdateWindowCaption(VOID)
67 CHAR szCaption[MAX_STRING_LEN];
68 CHAR szDate[MAX_STRING_LEN];
73 LPSYSTEMTIME lpst = &st;
76 GetDateFormat(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, lpst, NULL, date,
79 /* Set frame caption */
80 LoadString(Globals.hInstance, 0x10C, szCaption, sizeof(szCaption));
82 lstrcat(szCaption, " - ");
83 lstrcat(szCaption, szDate);
85 SetWindowText(Globals.hMainWnd, szCaption);
88 VOID LANGUAGE_LoadMenus(VOID)
90 CHAR szItem[MAX_STRING_LEN];
94 hMainMenu = LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU));
95 Globals.hPropertiesMenu = GetSubMenu(hMainMenu, 0);
96 Globals.hLanguageMenu = GetSubMenu(hMainMenu, 1);
97 Globals.hInfoMenu = GetSubMenu(hMainMenu, 2);
99 SetMenu(Globals.hMainWnd, hMainMenu);
101 /* Destroy old menu */
102 if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
103 Globals.hMainMenu = hMainMenu;
105 /* specific for Clock: */
107 LANGUAGE_UpdateMenuCheckmarks();
108 LANGUAGE_UpdateWindowCaption();
110 Globals.hSystemMenu = GetSystemMenu(Globals.hMainWnd, TRUE);
112 /* FIXME: Append a SEPARATOR to Globals.hSystemMenu here */
114 LoadString(Globals.hInstance, 0x10D, szItem, sizeof(szItem));
115 AppendMenu(Globals.hSystemMenu, MF_STRING | MF_BYCOMMAND, 1000, szItem);
119 VOID LANGUAGE_DefaultHandle(WPARAM wParam)
121 if ((wParam >=CL_FIRST_LANGUAGE) && (wParam<=CL_LAST_LANGUAGE))
122 LANGUAGE_SelectByNumber(wParam - CL_FIRST_LANGUAGE);
124 printf("Unimplemented menu command %i\n", wParam);
128 /* Local Variables: */
129 /* c-file-style: "GNU" */