- Implemented two lookup tables for the sample fonts. The first,

"CHARSET_ORDER", is for converting codepage to ordinal charset num,
  and the second, "SAMPLE_LANG_TEXT", is for giving the actual sample
  text.
- Removed all references to changing the font directly in stc5.
- Modified the "InvalidateRect" calls to invalidate the rect where
  stc5 is, rather than stc5 itself.
- Added handling of WM_PAINT that draws the sample text, properly
  truncated.
- Removed handling of WM_CTLCOLOR - no longer neccessary.
This commit is contained in:
Shachar Shemesh 2003-02-15 00:02:24 +00:00 committed by Alexandre Julliard
parent 5be7f69d72
commit ee63d5ee4a
21 changed files with 162 additions and 68 deletions

View file

@ -109,19 +109,29 @@ typedef struct {
#define IDS_CHARSET_ANSI 200
#define IDS_CHARSET_SYMBOL 201
#define IDS_CHARSET_SHIFTJIS 202
#define IDS_CHARSET_JIS 202
#define IDS_CHARSET_HANGUL 203
#define IDS_CHARSET_GREEK 204
#define IDS_CHARSET_TURKISH 205
#define IDS_CHARSET_HEBREW 206
#define IDS_CHARSET_ARABIC 207
#define IDS_CHARSET_BALTIC 208
#define IDS_CHARSET_VIETNAMESE 209
#define IDS_CHARSET_RUSSIAN 210
#define IDS_CHARSET_EE 211
#define IDS_CHARSET_THAI 212
#define IDS_CHARSET_JOHAB 213
#define IDS_CHARSET_OEM 214
#define IDS_CHARSET_GB2312 204
#define IDS_CHARSET_BIG5 205
#define IDS_CHARSET_GREEK 206
#define IDS_CHARSET_TURKISH 207
#define IDS_CHARSET_HEBREW 208
#define IDS_CHARSET_ARABIC 209
#define IDS_CHARSET_BALTIC 210
#define IDS_CHARSET_VIETNAMESE 211
#define IDS_CHARSET_RUSSIAN 212
#define IDS_CHARSET_EE 213
#define IDS_CHARSET_THAI 214
#define IDS_CHARSET_JOHAB 215
#define IDS_CHARSET_MAC 216
#define IDS_CHARSET_OEM 217
#define IDS_CHARSET_VISCII 218
#define IDS_CHARSET_TCVN 219
#define IDS_CHARSET_KOI8 220
#define IDS_CHARSET_ISO3 221
#define IDS_CHARSET_ISO4 222
#define IDS_CHARSET_ISO10 223
#define IDS_CHARSET_CELTIC 224
/* Color names string IDs */

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Exemple",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Eksempel",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -166,7 +166,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Muster",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Sample",grp2,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Ejemplo",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZzÑñ",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZzÑñ",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Näyte",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Exemple",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -135,7 +135,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Minta",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZzÁáÕõÉé",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZzÁáÕõÉé",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -135,7 +135,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Esempio",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}
CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185

View file

@ -136,7 +136,7 @@ FONT 8, "
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "サンプル",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Voorbeeld",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -133,7 +133,7 @@ WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT, 179,13,32,54
CONTROL "", 1139, "COMBOBOX", CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 6,120,84,100
CONTROL "Przyk³ad", 1073, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 98,72,160,49
CONTROL "AaBbYyZz\xB3", stc5, "STATIC", SS_NOPREFIX | WS_VISIBLE, 104,81,149,37
CONTROL "AaBbYyZz\xB3", stc5, "STATIC", SS_NOPREFIX | NOT WS_VISIBLE, 104,81,149,37
END
/* PUSHBUTTON "&Replace", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
* PUSHBUTTON "Replace &All", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP

View file

@ -136,7 +136,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Amostra",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "Ms Sans Serif"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Îáðàçåö",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -136,7 +136,7 @@ FONT 8, "MS Sans Serif"
COMBOBOX cmb4,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Vzorec",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -138,7 +138,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Vzorka",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}
CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185

View file

@ -134,7 +134,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Test",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -141,7 +141,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Egzimpe",1073,98,72,160,49,WS_GROUP
CTEXT "AaBbYyZzÅåÇçÛû",stc5,104,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZzÅåÇçÛû",stc5,104,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -87,7 +87,7 @@ FONT 8, "Helv"
COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
GROUPBOX "¹ Àý",1073,128,72,160,49,WS_GROUP
CTEXT "AaBbYyZz",stc5,134,81,149,37,SS_NOPREFIX | WS_VISIBLE
CTEXT "AaBbYyZz",stc5,134,81,149,37,SS_NOPREFIX | NOT WS_VISIBLE
}

View file

@ -49,6 +49,61 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
LPARAM lParam);
/* There is a table here of all charsets, and the sample text for each.
* There is a second table that translates a charset into an index into
* the first table.
*/
#define CI(cs) ((IDS_CHARSET_##cs)-IDS_CHARSET_ANSI)
#define SAMPLE_EXTLEN 10
static const WCHAR SAMPLE_LANG_TEXT[][SAMPLE_EXTLEN]={
{'Y','y','Z','z',0}, /* Western and default */
{0}, /* Symbol */
{0}, /* Shift JIS */
{0}, /* Hangul */
{0}, /* GB2312 */
{0}, /* BIG5 */
{0}, /* Greek */
{0}, /* Turkish */
{0x05e0, 0x05e1, 0x05e9, 0x05ea, 0}, /* Hebrew */
{0}, /* Arabic */
{0}, /* Baltic */
{0}, /* Vietnamese */
{0}, /* Russian */
{0}, /* East European */
{0}, /* Thai */
{0}, /* Johab */
{0}, /* Mac */
{0}, /* OEM */
{0}, /* VISCII */
{0}, /* TCVN */
{0}, /* KOI-8 */
{0}, /* ISO-8859-3 */
{0}, /* ISO-8859-4 */
{0}, /* ISO-8859-10 */
{0} /* Celtic */
};
static const int CHARSET_ORDER[256]={
CI(ANSI), 0, CI(SYMBOL), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(MAC), 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
CI(JIS), CI(HANGUL), CI(JOHAB), 0, 0, 0, CI(GB2312), 0, CI(BIG5), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, CI(GREEK), CI(TURKISH), CI(VIETNAMESE), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, CI(HEBREW), CI(ARABIC), 0, 0, 0, 0, 0, 0, 0, CI(BALTIC), 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(RUSSIAN), 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(THAI), 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(EE), 0,
CI(VISCII), CI(TCVN), CI(KOI8), CI(ISO3), CI(ISO4), CI(ISO10), CI(CELTIC), 0, 0, 0, 0, 0, 0, 0, 0, CI(OEM),
};
static void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 )
{
font32->lfHeight = font16->lfHeight;
@ -740,10 +795,6 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
if (!hBitmapTT)
hBitmapTT = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_TRTYPE));
/* This font will be deleted by WM_COMMAND */
SendDlgItemMessageA(hDlg,stc5,WM_SETFONT,
(WPARAM)CreateFontA(0, 0, 1, 1, 400, 0, 0, 0, 0, 0, 0, 0, 0, NULL),FALSE);
if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow(lpcf->hwndOwner))
ShowWindow(GetDlgItem(hDlg,pshHelp),SW_HIDE);
if (!(lpcf->Flags & CF_APPLY))
@ -977,28 +1028,12 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
/***********************************************************************
* CFn_WMCtlColor [internal]
*/
static LRESULT CFn_WMCtlColorStatic(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf)
{
if (lpcf->Flags & CF_EFFECTS)
if (GetDlgCtrlID(HWND_32(LOWORD(lParam)))==stc5)
{
SetTextColor((HDC)wParam, lpcf->rgbColors);
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
return 0;
}
/***********************************************************************
* CFn_WMCommand [internal]
*/
static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf)
{
HFONT hFont;
int i,j;
long l;
HDC hdc;
@ -1047,6 +1082,8 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
case cmb3:if (HIWORD(wParam)==CBN_SELCHANGE || HIWORD(wParam)== BN_CLICKED )
{
char str[256];
WINDOWINFO wininfo;
TRACE("WM_COMMAND/cmb2,3 =%08lX\n", lParam);
i=SendDlgItemMessageA(hDlg,cmb1,CB_GETCURSEL,0,0);
if (i==CB_ERR)
@ -1087,22 +1124,28 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
lpxx->lfQuality=DEFAULT_QUALITY;
lpcf->iPointSize= -10*lpxx->lfHeight;
hFont=CreateFontIndirectA(lpxx);
if (hFont)
wininfo.cbSize=sizeof(wininfo);
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &wininfo ) )
{
HFONT oldFont=(HFONT)SendDlgItemMessageA(hDlg, stc5,
WM_GETFONT, 0, 0);
SendDlgItemMessageA(hDlg,stc5,WM_SETFONT,(WPARAM)hFont,TRUE);
DeleteObject(oldFont);
InvalidateRect( hDlg, &wininfo.rcWindow, TRUE );
}
}
break;
case cmb4:i=SendDlgItemMessageA(hDlg, cmb4, CB_GETCURSEL, 0, 0);
case cmb4:
i=SendDlgItemMessageA(hDlg, cmb4, CB_GETCURSEL, 0, 0);
if (i!=CB_ERR)
{
WINDOWINFO wininfo;
lpcf->rgbColors=textcolors[i];
InvalidateRect( GetDlgItem(hDlg,stc5), NULL, 0 );
wininfo.cbSize=sizeof(wininfo);
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &wininfo ) )
{
InvalidateRect( hDlg, &wininfo.rcWindow, TRUE );
}
}
break;
@ -1134,10 +1177,57 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
static LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DeleteObject((HFONT)SendDlgItemMessageA(hwnd, stc5, WM_GETFONT, 0, 0));
return TRUE;
}
static LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTA lpcf )
{
WINDOWINFO info;
info.cbSize=sizeof(info);
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &info ) )
{
PAINTSTRUCT ps;
HDC hdc;
HPEN hOrigPen;
HFONT hOrigFont;
COLORREF rgbPrev;
WCHAR sample[SAMPLE_EXTLEN+5]={'A','a','B','b'};
/* Always start with this basic sample */
hdc=BeginPaint( hDlg, &ps );
/* Paint frame */
MoveToEx( hdc, info.rcWindow.left, info.rcWindow.bottom, NULL );
hOrigPen=SelectObject( hdc, CreatePen( PS_SOLID, 2,
GetSysColor( COLOR_3DSHADOW ) ));
LineTo( hdc, info.rcWindow.left, info.rcWindow.top );
LineTo( hdc, info.rcWindow.right, info.rcWindow.top );
DeleteObject(SelectObject( hdc, CreatePen( PS_SOLID, 2,
GetSysColor( COLOR_3DLIGHT ) )));
LineTo( hdc, info.rcWindow.right, info.rcWindow.bottom );
LineTo( hdc, info.rcWindow.left, info.rcWindow.bottom );
DeleteObject(SelectObject( hdc, hOrigPen ));
/* Draw the sample text itself */
lstrcatW(sample, SAMPLE_LANG_TEXT[CHARSET_ORDER[lpcf->lpLogFont->lfCharSet]] );
info.rcWindow.right--;
info.rcWindow.bottom--;
info.rcWindow.top++;
info.rcWindow.left++;
hOrigFont=SelectObject( hdc, CreateFontIndirectA( lpcf->lpLogFont ) );
rgbPrev=SetTextColor( hdc, lpcf->rgbColors );
DrawTextW( hdc, sample, -1, &info.rcWindow, DT_CENTER|DT_VCENTER|DT_SINGLELINE );
EndPaint( hDlg, &ps );
}
return FALSE;
}
/***********************************************************************
* FormatCharDlgProc (COMMDLG.16)
@ -1208,10 +1298,6 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
res = CFn_WMDrawItem(hDlg, wParam, (LPARAM)&dis);
}
break;
case WM_CTLCOLOR:
if (HIWORD(lParam) == CTLCOLOR_STATIC)
res=CFn_WMCtlColorStatic(hDlg, wParam, LOWORD(lParam), lpcf32a);
break;
case WM_COMMAND:
res=CFn_WMCommand(hDlg, MAKEWPARAM( wParam, HIWORD(lParam) ), LOWORD(lParam), lpcf32a);
break;
@ -1261,8 +1347,6 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
return CFn_WMMeasureItem(hDlg, wParam, lParam);
case WM_DRAWITEM:
return CFn_WMDrawItem(hDlg, wParam, lParam);
case WM_CTLCOLORSTATIC:
return CFn_WMCtlColorStatic(hDlg, wParam, lParam, lpcf);
case WM_COMMAND:
return CFn_WMCommand(hDlg, wParam, lParam, lpcf);
case WM_DESTROY:
@ -1272,6 +1356,8 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
lParam);
FIXME("current logfont back to caller\n");
break;
case WM_PAINT:
return CFn_WMPaint(hDlg, wParam, lParam, lpcf);
}
return res;
}
@ -1314,8 +1400,6 @@ INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
return CFn_WMMeasureItem(hDlg, wParam, lParam);
case WM_DRAWITEM:
return CFn_WMDrawItem(hDlg, wParam, lParam);
case WM_CTLCOLORSTATIC:
return CFn_WMCtlColorStatic(hDlg, wParam, lParam, lpcf32a);
case WM_COMMAND:
return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a);
case WM_DESTROY: