Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4eeadac1
Commit
4eeadac1
authored
Oct 23, 2002
by
Sylvain Petreolle
Committed by
Alexandre Julliard
Oct 23, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented NLS in progman.
parent
f871f2d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
151 additions
and
230 deletions
+151
-230
En.rc
programs/progman/En.rc
+0
-0
Fr.rc
programs/progman/Fr.rc
+0
-0
dialog.c
programs/progman/dialog.c
+10
-8
license.c
programs/progman/license.c
+9
-6
license.h
programs/progman/license.h
+3
-2
main.c
programs/progman/main.c
+9
-11
progman.h
programs/progman/progman.h
+91
-102
rsrc.rc
programs/progman/rsrc.rc
+14
-25
string.c
programs/progman/string.c
+15
-76
No files found.
programs/progman/En.rc
View file @
4eeadac1
This diff is collapsed.
Click to expand it.
programs/progman/Fr.rc
View file @
4eeadac1
This diff is collapsed.
Click to expand it.
programs/progman/dialog.c
View file @
4eeadac1
...
...
@@ -2,6 +2,7 @@
* Program Manager
*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
* Copyright 2002 Andriy Palamarchuk
*
* This library is free software; you can redistribute it and/or
...
...
@@ -48,7 +49,7 @@ INT DIALOG_New(INT nDefault)
New
.
nDefault
=
nDefault
;
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_NEW
_Xx
,
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_NEW
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
return
ret
;
...
...
@@ -110,7 +111,7 @@ HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszFromGroupName,
CopyMove
.
hToGroup
=
0
;
ret
=
DialogBox
(
Globals
.
hInstance
,
bMove
?
STRING_MOVE
_Xx
:
STRING_COPY_Xx
,
bMove
?
STRING_MOVE
:
STRING_COPY
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
...
...
@@ -199,7 +200,7 @@ BOOL DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszGrpFile, INT nSize)
GroupAttributes
.
lpszTitle
=
lpszTitle
;
GroupAttributes
.
lpszGrpFile
=
lpszGrpFile
;
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_GROUP
_Xx
,
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_GROUP
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
return
(
ret
==
IDOK
);
...
...
@@ -282,7 +283,7 @@ BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
ProgramAttributes
.
lpszTmpIconFile
=
szTmpIconFile
;
lstrcpyn
(
ProgramAttributes
.
lpszTmpIconFile
,
lpszIconFile
,
MAX_PATHNAME_LEN
);
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_PROGRAM
_Xx
,
ret
=
DialogBox
(
Globals
.
hInstance
,
STRING_PROGRAM
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
...
...
@@ -404,7 +405,7 @@ VOID DIALOG_Symbol(HICON *lphIcon, LPSTR lpszIconFile,
Symbol
.
lphIcon
=
lphIcon
;
Symbol
.
lpnIconIndex
=
lpnIconIndex
;
DialogBox
(
Globals
.
hInstance
,
STRING_SYMBOL
_Xx
,
DialogBox
(
Globals
.
hInstance
,
STRING_SYMBOL
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
}
...
...
@@ -488,10 +489,11 @@ static BOOL CALLBACK DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
VOID
DIALOG_Execute
()
{
DLGPROC
lpfnDlg
=
MakeProcInstance
(
DIALOG_EXECUTE_DlgProc
,
Globals
.
hInstance
);
DialogBox
(
Globals
.
hInstance
,
STRING_EXECUTE_Xx
,
INT_PTR
z
;
DLGPROC
lpfnDlg
=
MakeProcInstance
(
DIALOG_EXECUTE_DlgProc
,
Globals
.
hInstance
);
z
=
DialogBox
(
Globals
.
hInstance
,
STRING_EXECUTE
,
Globals
.
hMainWnd
,
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
FreeProcInstance
(
lpfnDlg
);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
programs/progman/license.c
View file @
4eeadac1
/*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -19,9 +20,9 @@
#include "windows.h"
#include "license.h"
#if 0
static LICENSE* SelectLanguage(LPCSTR Language)
{
#if 0
if (!lstrcmp(Language, "Cz")) return(&WineLicense_Cz);
if (!lstrcmp(Language, "Da")) return(&WineLicense_Da);
if (!lstrcmp(Language, "De")) return(&WineLicense_De);
...
...
@@ -37,21 +38,23 @@ static LICENSE* SelectLanguage(LPCSTR Language)
if (!lstrcmp(Language, "Pl")) return(&WineLicense_Pl);
if (!lstrcmp(Language, "Po")) return(&WineLicense_Po);
if (!lstrcmp(Language, "Va")) return(&WineLicense_Va);
#endif
return(&WineLicense_En);
}
#endif
VOID
WineLicense
(
HWND
Wnd
,
LPCSTR
Language
)
VOID
WineLicense
(
HWND
Wnd
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* LICENSE *License = SelectLanguage(Language); */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
License
,
License
->
LicenseCaption
,
MB_ICONINFORMATION
|
MB_OK
);
}
VOID
WineWarranty
(
HWND
Wnd
,
LPCSTR
Language
)
VOID
WineWarranty
(
HWND
Wnd
)
{
LICENSE
*
License
=
SelectLanguage
(
Language
);
/* LICENSE *License = SelectLanguage(Language); */
LICENSE
*
License
=
&
WineLicense_En
;
MessageBox
(
Wnd
,
License
->
Warranty
,
License
->
WarrantyCaption
,
MB_ICONEXCLAMATION
|
MB_OK
);
...
...
programs/progman/license.h
View file @
4eeadac1
/*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -16,8 +17,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
VOID
WineLicense
(
HWND
hWnd
,
LPCSTR
lpszLanguage
);
VOID
WineWarranty
(
HWND
hWnd
,
LPCSTR
language
);
VOID
WineLicense
(
HWND
hWnd
);
VOID
WineWarranty
(
HWND
hWnd
);
typedef
struct
{
...
...
programs/progman/main.c
View file @
4eeadac1
/*
* Program Manager
*
* Copyright 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -48,8 +49,6 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
Globals
.
lpszIniFile
=
"progman.ini"
;
Globals
.
lpszIcoFile
=
"progman.ico"
;
/* Select Language */
Globals
.
lpszLanguage
=
"En"
;
Globals
.
hInstance
=
hInstance
;
Globals
.
hGroups
=
0
;
Globals
.
hActiveGroup
=
0
;
...
...
@@ -83,7 +82,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
Globals
.
hAccel
=
LoadAccelerators
(
Globals
.
hInstance
,
STRING_ACCEL
);
/* Setup menu, stringtable and resourcenames */
STRING_
SelectLanguageByName
(
Globals
.
lpszLanguage
);
STRING_
LoadMenus
(
);
MAIN_CreateMDIWindow
();
...
...
@@ -180,8 +179,9 @@ static LRESULT CALLBACK MAIN_MainWndProc(HWND hWnd, UINT msg,
break
;
case
WM_COMMAND
:
if
(
wParam
<
PM_FIRST_CHILD
)
if
(
wParam
<
PM_FIRST_CHILD
)
{
MAIN_MenuCommand
(
hWnd
,
wParam
,
lParam
);
}
break
;
case
WM_DESTROY
:
...
...
@@ -296,6 +296,7 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* Menu Windows */
case
PM_ARRANGE
:
if
(
hActiveGroupWnd
&&
!
IsIconic
(
hActiveGroupWnd
))
ArrangeIconicWindows
(
hActiveGroupWnd
);
else
...
...
@@ -304,7 +305,7 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* Menu Help */
case
PM_CONTENTS
:
if
(
!
WinHelp
(
Globals
.
hMainWnd
,
"progman.hlp"
,
HELP_
INDEX
,
0
))
if
(
!
WinHelp
(
Globals
.
hMainWnd
,
"progman.hlp"
,
HELP_
CONTENTS
,
0
))
MAIN_MessageBoxIDS
(
IDS_WINHELP_ERROR
,
IDS_ERROR
,
MB_OK
);
break
;
...
...
@@ -318,11 +319,11 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
break
;
case
PM_LICENSE
:
WineLicense
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineLicense
(
Globals
.
hMainWnd
);
break
;
case
PM_NO_WARRANTY
:
WineWarranty
(
Globals
.
hMainWnd
,
Globals
.
lpszLanguage
);
WineWarranty
(
Globals
.
hMainWnd
);
break
;
case
PM_ABOUT_WINE
:
...
...
@@ -330,9 +331,6 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
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
;
}
...
...
programs/progman/progman.h
View file @
4eeadac1
...
...
@@ -2,6 +2,7 @@
* Program Manager
*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -25,8 +26,6 @@
#define MAX_PATHNAME_LEN 1024
#define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
#ifndef RC_INVOKED
#include "windows.h"
/* Fallback icon */
...
...
@@ -132,8 +131,6 @@ typedef struct
BOOL
bSaveSettings
;
BOOL
bMinOnRun
;
HLOCAL
hGroups
;
LPCSTR
lpszLanguage
;
UINT
wStringTableOffset
;
HLOCAL
hActiveGroup
;
}
GLOBALS
;
...
...
@@ -191,8 +188,7 @@ VOID DIALOG_Symbol(HICON *lphIcon, LPSTR lpszIconFile,
INT
*
lpnIconIndex
,
INT
nSize
);
VOID
DIALOG_Execute
(
void
);
VOID
STRING_SelectLanguageByName
(
LPCSTR
);
VOID
STRING_SelectLanguageByNumber
(
UINT
);
VOID
STRING_LoadMenus
(
VOID
);
/* Class names */
extern
CHAR
STRING_MAIN_WIN_CLASS_NAME
[];
...
...
@@ -202,128 +198,121 @@ extern CHAR STRING_PROGRAM_WIN_CLASS_NAME[];
/* Resource names */
extern
CHAR
STRING_ACCEL
[];
extern
CHAR
STRING_MAIN_Xx
[];
extern
CHAR
STRING_NEW_Xx
[];
extern
CHAR
STRING_OPEN_Xx
[];
extern
CHAR
STRING_MOVE_Xx
[];
extern
CHAR
STRING_COPY_Xx
[];
extern
CHAR
STRING_DELETE_Xx
[];
extern
CHAR
STRING_GROUP_Xx
[];
extern
CHAR
STRING_PROGRAM_Xx
[];
extern
CHAR
STRING_SYMBOL_Xx
[];
extern
CHAR
STRING_EXECUTE_Xx
[];
#define STRINGID(id) (0x##id + Globals.wStringTableOffset)
#else
/* RC_INVOKED */
#define STRINGID(id) id
#endif
extern
CHAR
STRING_MAIN
[];
extern
CHAR
STRING_NEW
[];
extern
CHAR
STRING_OPEN
[];
extern
CHAR
STRING_MOVE
[];
extern
CHAR
STRING_COPY
[];
extern
CHAR
STRING_DELETE
[];
extern
CHAR
STRING_GROUP
[];
extern
CHAR
STRING_PROGRAM
[];
extern
CHAR
STRING_SYMBOL
[];
extern
CHAR
STRING_EXECUTE
[];
/* Stringtable index */
#define IDS_LANGUAGE_ID STRINGID(00)
#define IDS_LANGUAGE_MENU_ITEM STRINGID(01)
#define IDS_PROGRAM_MANAGER STRINGID(02)
#define IDS_ERROR STRINGID(03)
#define IDS_WARNING STRINGID(04)
#define IDS_INFO STRINGID(05)
#define IDS_DELETE STRINGID(06)
#define IDS_DELETE_GROUP_s STRINGID(07)
#define IDS_DELETE_PROGRAM_s STRINGID(08)
#define IDS_NOT_IMPLEMENTED STRINGID(09)
#define IDS_FILE_READ_ERROR_s STRINGID(0a)
#define IDS_FILE_WRITE_ERROR_s STRINGID(0b)
#define IDS_GRPFILE_READ_ERROR_s STRINGID(0c)
#define IDS_OUT_OF_MEMORY STRINGID(0d)
#define IDS_WINHELP_ERROR STRINGID(0e)
#define IDS_UNKNOWN_FEATURE_s STRINGID(0f)
#define IDS_FILE_NOT_OVERWRITTEN_s STRINGID(10)
#define IDS_SAVE_GROUP_AS_s STRINGID(11)
#define IDS_NO_HOT_KEY STRINGID(12)
#define IDS_ALL_FILES STRINGID(13)
#define IDS_PROGRAMS STRINGID(14)
#define IDS_LIBRARIES_DLL STRINGID(15)
#define IDS_SYMBOL_FILES STRINGID(16)
#define IDS_SYMBOLS_ICO STRINGID(17)
#define IDS_PROGRAM_MANAGER 0x02
#define IDS_ERROR 0x03
#define IDS_WARNING 0x04
#define IDS_INFO 0x05
#define IDS_DELETE 0x06
#define IDS_DELETE_GROUP_s 0x07
#define IDS_DELETE_PROGRAM_s 0x08
#define IDS_NOT_IMPLEMENTED 0x09
#define IDS_FILE_READ_ERROR_s 0x0a
#define IDS_FILE_WRITE_ERROR_s 0x0b
#define IDS_GRPFILE_READ_ERROR_s 0x0c
#define IDS_OUT_OF_MEMORY 0x0d
#define IDS_WINHELP_ERROR 0x0e
#define IDS_UNKNOWN_FEATURE_s 0x0f
#define IDS_FILE_NOT_OVERWRITTEN_s 0x10
#define IDS_SAVE_GROUP_AS_s 0x11
#define IDS_NO_HOT_KEY 0x12
#define IDS_ALL_FILES 0x13
#define IDS_PROGRAMS 0x14
#define IDS_LIBRARIES_DLL 0x15
#define IDS_SYMBOL_FILES 0x16
#define IDS_SYMBOLS_ICO 0x17
/* Menu */
#define PM_NEW 100
#define PM_OPEN 101
#define PM_MOVE 102
#define PM_COPY 103
#define PM_DELETE 104
#define PM_ATTRIBUTES 105
#define PM_EXECUTE 107
#define PM_EXIT 108
#define MAIN_MENU 0x109
#define PM_NEW 0x100
#define PM_OPEN 0x101
#define PM_MOVE 0x102
#define PM_COPY 0x103
#define PM_DELETE 0x104
#define PM_ATTRIBUTES 0x105
#define PM_EXECUTE 0x107
#define PM_EXIT 0x108
#define PM_AUTO_ARRANGE 0x110
#define PM_MIN_ON_RUN 0x111
#define PM_SAVE_SETTINGS 0x113
#define PM_OVERLAP 0x120
#define PM_SIDE_BY_SIDE 0x121
#define PM_ARRANGE 0x122
#define PM_FIRST_CHILD 0x3030
#define PM_AUTO_ARRANGE 200
#define PM_MIN_ON_RUN 201
#define PM_SAVE_SETTINGS 203
#define PM_OVERLAP 300
#define PM_SIDE_BY_SIDE 301
#define PM_ARRANGE 302
#define PM_FIRST_CHILD 3030
#define PM_FIRST_LANGUAGE 400
#define PM_LAST_LANGUAGE 499
/*
*#define PM_FIRST_LANGUAGE 0x400
*#define PM_LAST_LANGUAGE 0x499
*/
#define PM_CONTENTS
50
1
#define PM_SEARCH
50
2
#define PM_HELPONHELP
50
3
#define PM_TUTORIAL
50
4
#define PM_CONTENTS
0x13
1
#define PM_SEARCH
0x13
2
#define PM_HELPONHELP
0x13
3
#define PM_TUTORIAL
0x13
4
#define PM_LICENSE
51
0
#define PM_NO_WARRANTY
51
1
#define PM_ABOUT_WINE
51
2
#define PM_LICENSE
0x14
0
#define PM_NO_WARRANTY
0x14
1
#define PM_ABOUT_WINE
0x14
2
/* Dialog `New' */
/* RADIOBUTTON: The next two must be in sequence */
#define PM_NEW_GROUP
100
0
#define PM_NEW_PROGRAM
100
1
#define PM_NEW_GROUP_TXT
100
2
#define PM_NEW_PROGRAM_TXT
100
3
#define PM_NEW_GROUP
0x15
0
#define PM_NEW_PROGRAM
0x15
1
#define PM_NEW_GROUP_TXT
0x15
2
#define PM_NEW_PROGRAM_TXT
0x15
3
/* Dialogs `Copy', `Move' */
#define PM_PROGRAM
120
0
#define PM_FROM_GROUP
120
1
#define PM_TO_GROUP
120
2
#define PM_TO_GROUP_TXT
120
3
#define PM_PROGRAM
0x16
0
#define PM_FROM_GROUP
0x16
1
#define PM_TO_GROUP
0x16
2
#define PM_TO_GROUP_TXT
0x16
3
/* Dialogs `Group attributes' */
#define PM_DESCRIPTION
150
0
#define PM_DESCRIPTION_TXT
150
1
#define PM_FILE
150
2
#define PM_FILE_TXT
150
3
#define PM_DESCRIPTION
0x17
0
#define PM_DESCRIPTION_TXT
0x17
1
#define PM_FILE
0x17
2
#define PM_FILE_TXT
0x17
3
/* Dialogs `Program attributes' */
#define PM_COMMAND_LINE
151
0
#define PM_COMMAND_LINE_TXT
151
1
#define PM_DIRECTORY
151
2
#define PM_DIRECTORY_TXT
151
3
#define PM_HOT_KEY
151
4
#define PM_HOT_KEY_TXT
151
5
#define PM_ICON
151
6
#define PM_OTHER_SYMBOL
151
7
#define PM_COMMAND_LINE
0x18
0
#define PM_COMMAND_LINE_TXT
0x18
1
#define PM_DIRECTORY
0x18
2
#define PM_DIRECTORY_TXT
0x18
3
#define PM_HOT_KEY
0x18
4
#define PM_HOT_KEY_TXT
0x18
5
#define PM_ICON
0x18
6
#define PM_OTHER_SYMBOL
0x18
7
/* Dialog `Symbol' */
#define PM_ICON_FILE
152
0
#define PM_ICON_FILE_TXT
152
1
#define PM_SYMBOL_LIST
152
2
#define PM_SYMBOL_LIST_TXT
152
3
#define PM_ICON_FILE
0x19
0
#define PM_ICON_FILE_TXT
0x19
1
#define PM_SYMBOL_LIST
0x19
2
#define PM_SYMBOL_LIST_TXT
0x19
3
/* Dialog `Execute' */
#define PM_COMMAND
160
0
#define PM_SYMBOL
160
1
#define PM_BROWSE
160
2
#define PM_HELP
160
3
#define PM_COMMAND
0x1a
0
#define PM_SYMBOL
0x1a
1
#define PM_BROWSE
0x1a
2
#define PM_HELP
0x1a
3
#endif
/* PROGMAN_H */
...
...
programs/progman/rsrc.rc
View file @
4eeadac1
...
...
@@ -18,32 +18,21 @@
#include "windows.h"
#include "progman.h"
#define CONCAT(a, b) CONCAT1(a, b)
#define CONCAT1(a, b) a##b
#define ADDSTRING(str) ADDSTRING1(LANGUAGE_NUMBER, IDS_ ## str) STRING_ ## str
#define ADDSTRING1(langnum, ids) ADDSTRING2(langnum, ids)
#define ADDSTRING2(langnum, ids) 0x ## langnum ## ids
#define STRINGIFY(str) STRINGIFY1(str)
#define STRINGIFY1(str) #str
#include "accel.rc"
#include "Da.rc"
#include "De.rc"
/* #include "Da.rc" */
/* #include "De.rc" */
#include "En.rc"
#include "Es.rc"
#include "Fi.rc"
/* #include "Es.rc" */
/* #include "Fi.rc" */
#include "Fr.rc"
#include "Hu.rc"
#include "It.rc"
#include "Ko.rc"
#include "Pt.rc"
#include "Si.rc"
#include "Sk.rc"
#include "Sw.rc"
#include "Va.rc"
#include "Wa.rc"
#include "Ru.rc"
/* #include "Hu.rc" */
/* #include "It.rc" */
/* #include "Ko.rc" */
/* #include "Pt.rc" */
/* #include "Si.rc" */
/* #include "Sk.rc" */
/* #include "Sw.rc" */
/* #include "Va.rc" */
/* #include "Wa.rc" */
/* #include "Ru.rc" */
programs/progman/string.c
View file @
4eeadac1
...
...
@@ -2,6 +2,7 @@
* Program Manager
*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Sylvain Petreolle
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -29,97 +30,35 @@ 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
)
CHAR
STRING_MENU
[]
=
"MENU"
;
CHAR
STRING_NEW
[]
=
"DIALOG_NEW"
;
CHAR
STRING_OPEN
[]
=
"DIALOG_OPEN"
;
CHAR
STRING_MOVE
[]
=
"DIALOG_MOVE"
;
CHAR
STRING_COPY
[]
=
"DIALOG_COPY"
;
CHAR
STRING_DELETE
[]
=
"DIALOG_DELETE"
;
CHAR
STRING_GROUP
[]
=
"DIALOG_GROUP"
;
CHAR
STRING_PROGRAM
[]
=
"DIALOG_PROGRAM"
;
CHAR
STRING_SYMBOL
[]
=
"DIALOG_SYMBOL"
;
CHAR
STRING_EXECUTE
[]
=
"DIALOG_EXECUTE"
;
VOID
STRING_LoadMenus
(
VOID
)
{
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
;
/* 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
);
hMainMenu
=
LoadMenu
(
Globals
.
hInstance
,
MAKEINTRESOURCE
(
MAIN_MENU
)
);
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment