comdlg32: Move font style names to resources.
This commit is contained in:
parent
1fd3797397
commit
89c86dd994
|
@ -126,6 +126,13 @@ typedef struct {
|
||||||
#define IDS_CHARSET_ISO10 223
|
#define IDS_CHARSET_ISO10 223
|
||||||
#define IDS_CHARSET_CELTIC 224
|
#define IDS_CHARSET_CELTIC 224
|
||||||
|
|
||||||
|
/* Font styles */
|
||||||
|
|
||||||
|
#define IDS_FONT_REGULAR 256
|
||||||
|
#define IDS_FONT_BOLD 257
|
||||||
|
#define IDS_FONT_ITALIC 258
|
||||||
|
#define IDS_FONT_BOLD_ITALIC 259
|
||||||
|
|
||||||
/* Color names string IDs */
|
/* Color names string IDs */
|
||||||
|
|
||||||
#define IDS_COLOR_BLACK 1040
|
#define IDS_COLOR_BLACK 1040
|
||||||
|
|
|
@ -443,6 +443,14 @@ Please install one and retry."
|
||||||
PD32_PRINTER_STATUS_POWER_SAVE "Power save mode; "
|
PD32_PRINTER_STATUS_POWER_SAVE "Power save mode; "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE /* Font styles */
|
||||||
|
{
|
||||||
|
IDS_FONT_REGULAR "Regular"
|
||||||
|
IDS_FONT_BOLD "Bold"
|
||||||
|
IDS_FONT_ITALIC "Italic"
|
||||||
|
IDS_FONT_BOLD_ITALIC "Bold Italic"
|
||||||
|
}
|
||||||
|
|
||||||
STRINGTABLE DISCARDABLE /* Color names */
|
STRINGTABLE DISCARDABLE /* Color names */
|
||||||
{
|
{
|
||||||
IDS_COLOR_BLACK "Black"
|
IDS_COLOR_BLACK "Black"
|
||||||
|
|
|
@ -449,6 +449,14 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_OPEN_FILE "Otwórz plik"
|
IDS_OPEN_FILE "Otwórz plik"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE /* Font styles */
|
||||||
|
{
|
||||||
|
IDS_FONT_REGULAR "Regularny"
|
||||||
|
IDS_FONT_BOLD "Pogrubiony"
|
||||||
|
IDS_FONT_ITALIC "Kusywa"
|
||||||
|
IDS_FONT_BOLD_ITALIC "Pogrubiona kursywa"
|
||||||
|
}
|
||||||
|
|
||||||
STRINGTABLE DISCARDABLE /* Color names */
|
STRINGTABLE DISCARDABLE /* Color names */
|
||||||
{
|
{
|
||||||
IDS_COLOR_BLACK "Czarny"
|
IDS_COLOR_BLACK "Czarny"
|
||||||
|
|
|
@ -357,17 +357,13 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
|
||||||
{
|
{
|
||||||
int italic;
|
int italic;
|
||||||
int weight;
|
int weight;
|
||||||
const WCHAR *stname;
|
UINT resId;
|
||||||
};
|
};
|
||||||
static const WCHAR strRegular[] = {'R','e','g','u','l','a','r',0};
|
|
||||||
static const WCHAR strItalic[] = {'I','t','a','l','i','c',0};
|
|
||||||
static const WCHAR strBold[] = {'B','o','l','d',0};
|
|
||||||
static const WCHAR strBoldItalic[] = {'B','o','l','d',' ','I','t','a','l','i','c',0};
|
|
||||||
static const struct FONTSTYLE fontstyles[FSTYLES]={
|
static const struct FONTSTYLE fontstyles[FSTYLES]={
|
||||||
{ 0, FW_NORMAL, strRegular },
|
{ 0, FW_NORMAL, IDS_FONT_REGULAR },
|
||||||
{ 1, FW_NORMAL, strItalic },
|
{ 1, FW_NORMAL, IDS_FONT_ITALIC },
|
||||||
{ 0, FW_BOLD, strBold },
|
{ 0, FW_BOLD, IDS_FONT_BOLD },
|
||||||
{ 1, FW_BOLD, strBoldItalic }
|
{ 1, FW_BOLD, IDS_FONT_BOLD_ITALIC }
|
||||||
};
|
};
|
||||||
HFONT hf;
|
HFONT hf;
|
||||||
TEXTMETRICW tm;
|
TEXTMETRICW tm;
|
||||||
|
@ -390,7 +386,9 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf)
|
||||||
(fontstyles[i].weight == FW_BOLD && tm.tmWeight > FW_MEDIUM)) &&
|
(fontstyles[i].weight == FW_BOLD && tm.tmWeight > FW_MEDIUM)) &&
|
||||||
((tm.tmItalic != 0)==fontstyles[i].italic))
|
((tm.tmItalic != 0)==fontstyles[i].italic))
|
||||||
{
|
{
|
||||||
j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)fontstyles[i].stname );
|
WCHAR name[64];
|
||||||
|
LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64);
|
||||||
|
j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name );
|
||||||
if (j==CB_ERR) return 1;
|
if (j==CB_ERR) return 1;
|
||||||
j=SendMessageW(hwnd, CB_SETITEMDATA, j,
|
j=SendMessageW(hwnd, CB_SETITEMDATA, j,
|
||||||
MAKELONG(tm.tmWeight,fontstyles[i].italic));
|
MAKELONG(tm.tmWeight,fontstyles[i].italic));
|
||||||
|
|
Loading…
Reference in New Issue