📄 ewndtest.pas
字号:
{************************************************}
{ }
{ ObjectWindows Demo }
{ Copyright (c) 1992 by Borland International }
{ }
{************************************************}
program EWndTest;
{$R EWNDTEST.RES}
uses WinTypes, WinProcs, Strings, OWindows, OStdWnds;
const
cm_SendText = 399;
type
TTestApplication = object(TApplication)
procedure InitMainWindow; virtual;
end;
PTestWindow = ^TTestWindow;
TTestWindow = object(TEditWindow)
constructor Init(AParent: PWindowsObject; ATitle: PChar);
procedure HandleSend(var Msg: TMessage);
virtual cm_First + cm_SendText;
end;
{ --------TTestWindow methods------------------ }
constructor TTestWindow.Init(AParent: PWindowsObject; ATitle: PChar);
begin
inherited Init(AParent, ATitle);
Attr.Menu := LoadMenu(HInstance, MakeIntResource(102));
end;
procedure TTestWindow.HandleSend(var Msg: TMessage);
var
Lines: Integer;
Text: array[0..20] of Char;
begin
Lines := Editor^.GetNumLines;
Str(Lines, Text);
StrCat(Text, ' lines sent');
MessageBox(HWindow, @Text, 'Message Sent', mb_Ok);
end;
{ -----------TTestApplication Methods------------ }
procedure TTestApplication.InitMainWindow;
begin
MainWindow := New(PTestWindow, Init(nil, 'Edit Window Tester'));
HAccTable := LoadAccelerators(HInstance, MakeIntResource(100));
end;
var
TestApp : TTestApplication;
begin
TestApp.Init('EWndTest');
TestApp.Run;
TestApp.Done;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -