wine/programs/progman/string.c
Alexandre Julliard 9ea19e54cb Release 970101
Wed Jan  1 15:36:17 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/listbox.c]
	Use FindFirstFile/FindNextFile in LISTBOX_Directory.

	* [files/dos_fs.c]
	Rewrote FindFirstFile/FindNextFile to use DOSFS_FindNext().

	* [files/file.c] [files/directory.c]
	Use Win32 kernel objects and handles for file handles.
	Unified SearchPath() and OpenFile().

	* [loader/builtin.c]
	Moved to if1632/ directory.

	* [tools/build.c] [debugger/*] [miscemu/*]
	Win16 register functions now receive the same CONTEXT * structure
	as Win32 functions.

	* [include/sigcontext.h] [miscemu/instr.c]
	Added new macros to get register values from the SIGCONTEXT
	structure (only used for instruction emulation now).

	* [scheduler/process.c] [scheduler/thread.c] (New files)
	Allocate process and thread structures.

	* [scheduler/process.c] [win32/k32obj.c]
	Added Win32 kernel objects and handles management.

	* [loader/task.c]
	Create a Win32 process and thread for every Win16 task.

	* [misc/commdlg.c] [misc/shell.c] [windows/msgbox.c]
	Built-in resources are now in Win32 format. This also avoids
	16-bit callbacks for built-in dialogs.

	* [misc/lzexpand.c]
	Differentiate between 16-bit and 32-bit file handles.

	* [miscemu/int*.c]
	Moved all int emulation to msdos/ directory.

	* [msdos/*]
	New directory msdos/ contains all MS-DOS emulation code that can
	also be used for Winelib; this should enable Winelib apps to use
	DOS3Call and related functions.

	* [rc/winerc.c]
	A few bug fixes for Win32 resource format.

	* [windows/winpos.c]
	Hack in WINPOS_ReorderOwnerPopups() to avoid X crashed (still not
	right though).

Sun Dec 29 17:47:55 1996  O. Flebbe <flebbe@science-computing.uni-tuebingen.de>

	* [loader/pe_image.c]
	Make sure BSS of a PE_Image is zero.

Sat Dec 28 22:15:34 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [windows/scroll.c]
	ScrollWindowEx() rewrite, ScrollDC() fix.

	* [windows/nonclient.c] [controls/menu.c]
	Fixed Alt-Space crashes in dialogs.

	* [windows/event.c] [windows/message.c]
	Some changes in mouse message generation.

Thu Dec 26 09:25:24 1996  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [debugger/stabs.c]
	Dummy DEBUG_ReadExecutableDbgInfo provided for !__ELF__ case.

Tue Dec 24 00:59:05 MET 1996  Martin Buck <martin-2.buck@student.uni-ulm.de>

	* [windows/event.c]
	Changed XK_Page_{Up,Down} to XK_{Prior,Next} for X11R5
	compatibility.
1997-01-01 17:29:55 +00:00

141 lines
4.3 KiB
C

/*
* Program Manager
*
* Copyright 1996 Ulrich Schmid
*/
#include "windows.h"
#ifdef WINELIB
#include "options.h"
#endif
#include "progman.h"
/* Class names */
CHAR STRING_MAIN_WIN_CLASS_NAME[] = "PMMain";
CHAR STRING_MDI_WIN_CLASS_NAME[] = "MDICLIENT";
CHAR STRING_GROUP_WIN_CLASS_NAME[] = "PMGroup";
CHAR STRING_PROGRAM_WIN_CLASS_NAME[] = "PMProgram";
/* Resource names */
/* Xx will be overwritten with En, ... */
CHAR STRING_ACCEL[] = "ACCEL";
CHAR STRING_MENU_Xx[] = "MENU_Xx";
CHAR STRING_NEW_Xx[] = "DIALOG_NEW_Xx";
CHAR STRING_OPEN_Xx[] = "DIALOG_OPEN_Xx";
CHAR STRING_MOVE_Xx[] = "DIALOG_MOVE_Xx";
CHAR STRING_COPY_Xx[] = "DIALOG_COPY_Xx";
CHAR STRING_DELETE_Xx[] = "DIALOG_DELETE_Xx";
CHAR STRING_GROUP_Xx[] = "DIALOG_GROUP_Xx";
CHAR STRING_PROGRAM_Xx[] = "DIALOG_PROGRAM_Xx";
CHAR STRING_SYMBOL_Xx[] = "DIALOG_SYMBOL_Xx";
CHAR STRING_EXECUTE_Xx[] = "DIALOG_EXECUTE_Xx";
static BOOL STRING_LoadStringOtherLanguage(UINT num, UINT ids, LPSTR str, UINT len)
{
ids -= Globals.wStringTableOffset;
ids += num * 0x100;
return(LoadString(Globals.hInstance, ids, str, len));
};
VOID STRING_SelectLanguageByName(LPCSTR lang)
{
INT i;
CHAR newlang[3];
for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
if (STRING_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) &&
!lstrcmp(lang, newlang))
{
STRING_SelectLanguageByNumber(i);
return;
}
/* Fallback */
for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
if (STRING_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)))
{
STRING_SelectLanguageByNumber(i);
return;
}
MessageBox(Globals.hMainWnd, "No language found", "FATAL ERROR", MB_OK);
PostQuitMessage(1);
}
VOID STRING_SelectLanguageByNumber(UINT num)
{
INT i;
CHAR lang[3];
CHAR caption[MAX_STRING_LEN];
CHAR item[MAX_STRING_LEN];
HMENU hMainMenu;
HLOCAL hGroup;
/* Select string table */
Globals.wStringTableOffset = num * 0x100;
/* Get Language id */
LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang));
Globals.lpszLanguage = lang;
/* Set frame caption */
LoadString(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
SetWindowText(Globals.hMainWnd, caption);
/* Change Resource names */
lstrcpyn(STRING_MENU_Xx + sizeof(STRING_MENU_Xx) - 3, lang, 3);
lstrcpyn(STRING_NEW_Xx + sizeof(STRING_NEW_Xx) - 3, lang, 3);
lstrcpyn(STRING_OPEN_Xx + sizeof(STRING_OPEN_Xx) - 3, lang, 3);
lstrcpyn(STRING_MOVE_Xx + sizeof(STRING_MOVE_Xx) - 3, lang, 3);
lstrcpyn(STRING_COPY_Xx + sizeof(STRING_COPY_Xx) - 3, lang, 3);
lstrcpyn(STRING_DELETE_Xx + sizeof(STRING_DELETE_Xx) - 3, lang, 3);
lstrcpyn(STRING_GROUP_Xx + sizeof(STRING_GROUP_Xx) - 3, lang, 3);
lstrcpyn(STRING_PROGRAM_Xx + sizeof(STRING_PROGRAM_Xx) - 3, lang, 3);
lstrcpyn(STRING_SYMBOL_Xx + sizeof(STRING_SYMBOL_Xx) - 3, lang, 3);
lstrcpyn(STRING_EXECUTE_Xx + sizeof(STRING_EXECUTE_Xx) - 3, lang, 3);
/* Create menu */
hMainMenu = LoadMenu(Globals.hInstance, STRING_MENU_Xx);
Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
/* Remove dummy item */
RemoveMenu(Globals.hLanguageMenu, 0, MF_BYPOSITION);
/* Add language items */
for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++)
if (STRING_LoadStringOtherLanguage(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item)))
AppendMenu(Globals.hLanguageMenu, MF_STRING | MF_BYCOMMAND,
PM_FIRST_LANGUAGE + i, item);
if (Globals.hMDIWnd)
SendMessage(Globals.hMDIWnd, WM_MDISETMENU,
(WPARAM) hMainMenu,
(LPARAM) Globals.hWindowsMenu);
else SetMenu(Globals.hMainWnd, hMainMenu);
/* Destroy old menu */
if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
Globals.hMainMenu = hMainMenu;
#ifdef WINELIB
/* Update system menus */
for (i = 0; Languages[i].name && lstrcmp(lang, Languages[i].name);) i++;
if (Languages[i].name) Options.language = i;
GetSystemMenu(Globals.hMainWnd, TRUE);
for (hGroup = GROUP_FirstGroup(); hGroup;
hGroup = GROUP_NextGroup(hGroup))
{
GROUP *group = LocalLock(hGroup);
GetSystemMenu(group->hWnd, TRUE);
}
#endif
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */