4 * Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
5 * Copyright 1998 Karl Backstrm <karl_b@geocities.com>
6 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 CHAR STRING_MENU_Xx[] = "MENU_Xx";
29 CHAR STRING_PAGESETUP_Xx[] = "DIALOG_PAGESETUP_Xx";
31 void LANGUAGE_UpdateWindowCaption(void) {
32 /* Sets the caption of the main window according to Globals.szFileName:
33 Notepad - (untitled) if no file is open
34 Notepad - [filename] if a file is given
37 CHAR szCaption[MAX_STRING_LEN];
38 CHAR szUntitled[MAX_STRING_LEN];
40 LoadString(Globals.hInstance, STRING_NOTEPAD, szCaption, sizeof(szCaption));
42 if (strlen(Globals.szFileName)>0) {
43 lstrcat(szCaption, " - [");
44 lstrcat(szCaption, Globals.szFileName);
45 lstrcat(szCaption, "]");
49 LoadString(Globals.hInstance, STRING_UNTITLED, szUntitled, sizeof(szUntitled));
50 lstrcat(szCaption, " - ");
51 lstrcat(szCaption, szUntitled);
54 SetWindowText(Globals.hMainWnd, szCaption);
60 static BOOL LANGUAGE_LoadStringOther(UINT num, UINT ids, LPSTR str, UINT len)
64 ids -= Globals.wStringTableOffset;
67 bOk = LoadString(Globals.hInstance, ids, str, len);
72 VOID LANGUAGE_LoadMenus(VOID)
76 /* Set frame caption */
77 LANGUAGE_UpdateWindowCaption();
79 /* Change Resource names */
80 // lstrcpyn(STRING_MENU_Xx + sizeof(STRING_MENU_Xx) - 3, lang, 3);
81 // lstrcpyn(STRING_PAGESETUP_Xx + sizeof(STRING_PAGESETUP_Xx) - 3, lang, 3);
84 hMainMenu = LoadMenu(Globals.hInstance, MAIN_MENU);
85 Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
86 Globals.hEditMenu = GetSubMenu(hMainMenu, 1);
87 Globals.hSearchMenu = GetSubMenu(hMainMenu, 2);
88 Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
89 Globals.hHelpMenu = GetSubMenu(hMainMenu, 4);
91 SetMenu(Globals.hMainWnd, hMainMenu);
93 /* Destroy old menu */
94 if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
95 Globals.hMainMenu = hMainMenu;
98 //VOID LANGUAGE_DefaultHandle(WPARAM wParam)
100 // if ((wParam >=NP_FIRST_LANGUAGE) && (wParam<=NP_LAST_LANGUAGE))
101 // LANGUAGE_SelectByNumber(wParam - NP_FIRST_LANGUAGE);
102 // else printf("Unimplemented menu command %i\n", wParam);