User program templates added

This commit is contained in:
Владислав Джавадов 2020-06-12 14:16:18 +03:00
parent 26b5b29b50
commit 975d36c3fd
6 changed files with 56 additions and 0 deletions

10
My/Console/Program1.dpr Normal file
View File

@ -0,0 +1,10 @@
program Program1;
uses
CRT;
begin
InitConsole('Hello', True);
WriteLn('My first program');
ReadKey;
end.

1
My/Console/build.bat Normal file
View File

@ -0,0 +1 @@
@call "%~dp0..\..\Lib\build.bat" "%~dp0Program1"

33
My/GUI/Program2.dpr Normal file
View File

@ -0,0 +1,33 @@
program Program2;
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
TerminateThread;
end;
end.

1
My/GUI/build.bat Normal file
View File

@ -0,0 +1 @@
@call "%~dp0..\..\Lib\build.bat" "%~dp0Program2"

3
build-all.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
call build-examples.bat
call build-my.bat

8
build-my.bat Normal file
View File

@ -0,0 +1,8 @@
@echo off
for /d %%f in (%~dp0My\*) do (
call %%f\build.bat
if errorlevel 1 goto exit
)
:exit