home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1992
/
20
/
ln1120
/
test4.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-08-02
|
1KB
|
48 lines
{
Title: TEST4.PAS
Caption: A small OWL program to show off the BWCC-like customized font dialog.
}
program Test4;
uses winprocs, wintypes, wobjects, commdlg, UTest4, strings;
{$R Test4}
type
TMyApp = object(TApplication)
procedure InitMainWindow; virtual;
end;
PMyMainWindow = ^TMyMainWindow;
TMyMainWindow = object(TMDIWindow)
procedure cmChooseFont(var Msg: TMessage); virtual cm_First + 101;
end;
procedure TMyMainWindow.cmChooseFont(var Msg: TMessage);
var
LF: TLogFont;
Result: Integer;
begin
FillChar(LF, Sizeof(LF), 0);
Result := Application^.ExecDialog(New(PChooseFontDlg,
Init(@Self, 0, @LF)));
if Result = idOk then
MessageBox(HWindow, LF.lfFaceName, 'You selected', mb_OK);
end;
procedure TMyApp.InitMainWindow;
begin
MainWindow := new(PMyMainWindow, Init('Test CommDlg',
LoadMenu(HInstance, 'MainMenu')));
end;
var MyApp: TMyApp;
begin
MyApp.Init('TestCommDlg');
MyApp.Run;
MyApp.Done;
end.