mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2024-11-09 09:40:27 +01:00
User program templates added
This commit is contained in:
parent
26b5b29b50
commit
975d36c3fd
10
My/Console/Program1.dpr
Normal file
10
My/Console/Program1.dpr
Normal 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
1
My/Console/build.bat
Normal file
@ -0,0 +1 @@
|
||||
@call "%~dp0..\..\Lib\build.bat" "%~dp0Program1"
|
33
My/GUI/Program2.dpr
Normal file
33
My/GUI/Program2.dpr
Normal 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
1
My/GUI/build.bat
Normal file
@ -0,0 +1 @@
|
||||
@call "%~dp0..\..\Lib\build.bat" "%~dp0Program2"
|
3
build-all.bat
Normal file
3
build-all.bat
Normal file
@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call build-examples.bat
|
||||
call build-my.bat
|
8
build-my.bat
Normal file
8
build-my.bat
Normal file
@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
|
||||
for /d %%f in (%~dp0My\*) do (
|
||||
call %%f\build.bat
|
||||
if errorlevel 1 goto exit
|
||||
)
|
||||
|
||||
:exit
|
Loading…
Reference in New Issue
Block a user