fix ugly headers when using large fonts

This commit is contained in:
Chris Danford
2006-02-08 20:57:09 +00:00
parent 27c0547052
commit 4d6d0f9815
7 changed files with 29 additions and 37 deletions
@@ -163,21 +163,6 @@ void ChangeGameSettings::OnOK()
CDialog::OnOK();
}
HBRUSH ChangeGameSettings::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if( pWnd->GetDlgCtrlID() == IDC_STATIC_HEADER_TEXT )
{
hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
pDC->SetBkMode(TRANSPARENT);
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
/*
* (c) 2002-2005 Chris Danford
* All rights reserved.
@@ -40,7 +40,6 @@ protected:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
};
//{{AFX_INSERT_LOCATION}}
+9 -3
View File
@@ -174,6 +174,8 @@ BOOL MainMenuDlg::OnInitDialog()
DialogUtil::LocalizeDialogAndContents( *this );
DialogUtil::SetHeaderFont( *this, IDC_STATIC_HEADER_TEXT );
//DialogUtil::SetDlgItemHeader( *this, IDC_STATIC_HEADER_TEXT, "header" );
TCHAR szCurDir[MAX_PATH];
GetCurrentDirectory( ARRAYSIZE(szCurDir), szCurDir );
GetDlgItem( IDC_EDIT_INSTALLATION )->SetWindowText( szCurDir );
@@ -263,10 +265,14 @@ HBRUSH MainMenuDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if( pWnd->GetDlgCtrlID() == IDC_STATIC_HEADER_TEXT )
switch( pWnd->GetDlgCtrlID() )
{
hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
pDC->SetBkMode(TRANSPARENT);
case IDC_STATIC_HEADER_TEXT:
case IDC_STATIC_ICON:
hbr = (HBRUSH)::GetStockObject(WHITE_BRUSH);
pDC->SetBkMode(OPAQUE);
pDC->SetBkColor( RGB(255,255,255) );
break;
}
// TODO: Return a different brush if the default is not desired
@@ -415,10 +415,14 @@ HBRUSH CSMPackageInstallDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if( pWnd->GetDlgCtrlID() == IDC_STATIC_HEADER_TEXT )
switch( pWnd->GetDlgCtrlID() )
{
hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
pDC->SetBkMode(TRANSPARENT);
case IDC_STATIC_HEADER_TEXT:
case IDC_STATIC_ICON:
hbr = (HBRUSH)::GetStockObject(WHITE_BRUSH);
pDC->SetBkMode(OPAQUE);
pDC->SetBkColor( RGB(255,255,255) );
break;
}
// TODO: Return a different brush if the default is not desired
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

+2 -3
View File
@@ -64,7 +64,6 @@
#define IDC_DONTSHOW 1042
#define IDC_PACKAGES 1044
#define IDC_BUTTON1 1045
#define IDB_HEADER 1045
#define IDC_BUTTON_DELETE 1046
#define IDC_PROGRESS1 1047
#define IDC_RADIO_DEFAULT 1048
@@ -88,9 +87,9 @@
#define IDC_COMBO_LANGUAGES 1065
#define IDC_CHECK_EXPORT_ALREADY_TRANSLATED 1066
#define IDC_STATIC_HEADER_TEXT 1067
#define IDC_STATIC_CONTENTS 1068
#define IDC_STATIC_MESSAGE2 1068
#define IDC_STATIC_MESSAGE1 1069
#define IDC_STATIC_ICON 1070
// Next default values for new objects
//
@@ -98,7 +97,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 155
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1070
#define _APS_NEXT_CONTROL_VALUE 1071
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
+11 -12
View File
@@ -84,7 +84,6 @@ BEGIN
DEFPUSHBUTTON "Finish >",IDOK,200,215,55,15
PUSHBUTTON "Cancel",IDCANCEL,275,215,50,15
PUSHBUTTON "< Back",IDC_BUTTON_BACK,145,215,55,15,WS_DISABLED
CONTROL 1045,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38
EDITTEXT IDC_EDIT_MESSAGE2,5,90,320,87,ES_MULTILINE |
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | NOT
WS_TABSTOP
@@ -93,13 +92,17 @@ BEGIN
PUSHBUTTON "Edit Installations",IDC_BUTTON_EDIT,233,194,85,14
CONTROL "",IDC_PROGRESS1,"msctls_progress32",NOT WS_VISIBLE |
WS_BORDER,7,72,318,14
LTEXT "Install a package",IDC_STATIC_HEADER_TEXT,5,5,280,24
LTEXT "You have chosen to install the package:",
IDC_STATIC_MESSAGE1,7,41,318,10
LTEXT "This package contains the following files:",
IDC_STATIC_MESSAGE2,7,76,318,10
LTEXT "The package will be installed in the following program folder:",
IDC_STATIC,7,181,318,10
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT,0,0,331,33
LTEXT "Install a package",IDC_STATIC_HEADER_TEXT,6,4,273,20
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,33,331,1
ICON IDR_MAINFRAME,IDC_STATIC_ICON,295,6,21,20,0,
WS_EX_TRANSPARENT
END
IDD_EXPORTER DIALOGEX 0, 0, 349, 222
@@ -165,8 +168,10 @@ STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "StepMania Tools Main Menu"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT,0,0,331,33
LTEXT "StepMania Tools Main Menu",IDC_STATIC_HEADER_TEXT,6,4,
273,20
DEFPUSHBUTTON "Exit",IDOK,275,263,50,14
CONTROL 1045,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38
GROUPBOX "Installation",IDC_STATIC,7,41,318,28
PUSHBUTTON "Edit Installations",IDC_EDIT_INSTALLATIONS,233,49,83,15
GROUPBOX "Create and Share",IDC_STATIC,7,176,318,78
@@ -191,12 +196,13 @@ BEGIN
PUSHBUTTON "Languages",IDC_LANGUAGES,14,232,91,15
LTEXT "Create a new or manage existing language translations.",
IDC_STATIC,109,232,213,20
LTEXT "StepMania Tools Main Menu",IDC_STATIC_HEADER_TEXT,5,5,
280,24
LTEXT "Open the preferences file to make changes by hand.",
IDC_STATIC,109,127,213,18
LTEXT "Clear all preferences if you've made changes and the game won't start.",
IDC_STATIC,109,106,213,18
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,33,331,1
ICON IDR_MAINFRAME,IDC_STATIC_ICON,295,6,21,20,0,
WS_EX_TRANSPARENT
END
IDD_ENTER_COMMENT DIALOGEX 0, 0, 312, 202
@@ -460,13 +466,6 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_HEADER BITMAP "header.bmp"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////