Implemented font selection.
Added accelerators resources.
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 1faa023..ab5d00e 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -504,7 +504,7 @@
/* I don't know what's up with this TextOut command. This comes out
kind of mangled.
*/
- TextOut(hContext, border*2, border+szMetric.cy*0.5, szDocumentName, count);
+ TextOut(hContext, border*2, border+szMetric.cy/2, szDocumentName, count);
}
/* The starting point for the main text */
@@ -669,6 +669,29 @@
MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
}
+VOID DIALOG_SelectFont(VOID)
+{
+ CHOOSEFONT cf;
+ LOGFONT lf=Globals.lfFont;
+
+ ZeroMemory( &cf, sizeof(cf) );
+ cf.lStructSize=sizeof(cf);
+ cf.hwndOwner=Globals.hMainWnd;
+ cf.lpLogFont=&lf;
+ cf.Flags=CF_SCREENFONTS;
+
+ if( ChooseFont(&cf) )
+ {
+ HFONT currfont=Globals.hFont;
+
+ Globals.hFont=CreateFontIndirect( &lf );
+ Globals.lfFont=lf;
+ SendMessage( Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)TRUE );
+ if( currfont!=NULL )
+ DeleteObject( currfont );
+ }
+}
+
VOID DIALOG_Search(VOID)
{
ZeroMemory(&Globals.find, sizeof(Globals.find));