2021-01-03 11:06:04 +01:00
|
|
|
program MyGUI;
|
2020-06-12 13:16:18 +02:00
|
|
|
|
|
|
|
uses
|
|
|
|
KolibriOS;
|
|
|
|
|
|
|
|
var
|
|
|
|
WndLeft, WndTop, WndWidth, WndHeight: Integer;
|
|
|
|
|
|
|
|
begin
|
|
|
|
with GetScreenSize do
|
|
|
|
begin
|
|
|
|
WndWidth := Width div 4;
|
|
|
|
WndHeight := Height div 4;
|
|
|
|
WndLeft := (Width - WndWidth) div 2;
|
|
|
|
WndTop := (Height - WndHeight) div 2;
|
|
|
|
end;
|
|
|
|
|
|
|
|
while True do
|
|
|
|
case WaitEvent of
|
|
|
|
REDRAW_EVENT:
|
|
|
|
begin
|
|
|
|
BeginDraw;
|
|
|
|
DrawWindow(WndLeft, WndTop, WndWidth, WndHeight, 'My GUI Program', $00FFFFFF,
|
|
|
|
WS_SKINNED_FIXED + WS_CLIENT_COORDS + WS_CAPTION, CAPTION_MOVABLE);
|
|
|
|
EndDraw;
|
|
|
|
end;
|
|
|
|
KEY_EVENT:
|
|
|
|
GetKey;
|
|
|
|
BUTTON_EVENT:
|
|
|
|
if GetButton.ID = 1 then
|
2021-01-03 11:01:45 +01:00
|
|
|
Break;
|
2020-06-12 13:16:18 +02:00
|
|
|
end;
|
|
|
|
end.
|