2007-09-28 14:26:28 +02:00
|
|
|
|
|
|
|
|
|
{ <20> FreePascal 2.2.0 <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> cp866 <20><> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. }
|
|
|
|
|
{-$codepage cp866}
|
|
|
|
|
|
2007-09-12 18:34:21 +02:00
|
|
|
|
{$mode objfpc}
|
|
|
|
|
{$smartlink on}
|
2008-04-12 11:48:18 +02:00
|
|
|
|
{$apptype gui}
|
2007-09-12 18:34:21 +02:00
|
|
|
|
|
|
|
|
|
program Example;
|
|
|
|
|
|
|
|
|
|
{ <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㭪樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD> 'kos_' <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ମ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᨬ묨
|
2008-04-12 11:48:18 +02:00
|
|
|
|
<EFBFBD> ॠ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 <EFBFBD><EFBFBD><EFBFBD> KolibriOS. <EFBFBD><EFBFBD> <EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ணࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2007-09-12 18:34:21 +02:00
|
|
|
|
<EFBFBD>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⥣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨ <EFBFBD><EFBFBD> ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>뭮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⮤<EFBFBD>, <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥
|
2008-04-12 11:48:18 +02:00
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㭪樨, <EFBFBD> <EFBFBD>⤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>㫨 (<EFBFBD> <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࠪ樨). }
|
|
|
|
|
|
2007-09-12 18:34:21 +02:00
|
|
|
|
|
|
|
|
|
procedure DoPaint;
|
|
|
|
|
{ <20>뢮<EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
|
|
|
|
begin
|
|
|
|
|
kos_begindraw();
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC> <20><><EFBFBD><EFBFBD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
kos_definewindow(200, 200, 200, 50, $23AABBCC);
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ kos_definewindow <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>뢮<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>⤥<EFBFBD>쭮<EFBFBD> <EFBFBD>㭪樥<EFBFBD> kos_setcaption }
|
|
|
|
|
|
|
|
|
|
{ <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
kos_setcaption('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20>뢮<EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
kos_drawtext(3, 8, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...');
|
|
|
|
|
kos_enddraw();
|
|
|
|
|
end;
|
|
|
|
|
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
2007-09-12 18:34:21 +02:00
|
|
|
|
procedure DoKey;
|
|
|
|
|
{ <20><>ࠡ<EFBFBD>⪠ ᮡ<><E1AEA1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
|
|
|
|
var
|
|
|
|
|
Key: DWord;
|
|
|
|
|
Notes: array[0..3] of Byte;
|
|
|
|
|
begin
|
|
|
|
|
Key := kos_getkey();
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20><><EFBFBD><EFBFBD>ࠨ<EFBFBD><E0A0A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
Notes[0] := $90;
|
|
|
|
|
Notes[1] := Key shr 8;
|
|
|
|
|
Notes[2] := $00;
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
2007-09-28 14:26:28 +02:00
|
|
|
|
kos_speaker(@Notes);
|
2007-09-12 18:34:21 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DoButton: Boolean;
|
|
|
|
|
{ <20><>ࠡ<EFBFBD>⪠ ᮡ<><E1AEA1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GUI }
|
|
|
|
|
var
|
|
|
|
|
Button: DWord;
|
|
|
|
|
begin
|
2008-04-12 11:48:18 +02:00
|
|
|
|
{ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
Button := kos_getbutton();
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20> [x], <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0AEA2><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨥ <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
2007-09-28 14:26:28 +02:00
|
|
|
|
Result := Button <> 1;
|
2007-09-12 18:34:21 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ProcessMessage: Boolean;
|
2007-09-28 14:26:28 +02:00
|
|
|
|
{ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ࠡ<EFBFBD>⪠ ᮡ<EFBFBD>⨩.
|
|
|
|
|
|
|
|
|
|
@return: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> False, <EFBFBD> <EFBFBD>뫮 ᮡ<EFBFBD>⨥ <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
2008-04-12 11:48:18 +02:00
|
|
|
|
@rtype : True <EFBFBD><EFBFBD><EFBFBD> False }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
var
|
|
|
|
|
Event: DWord;
|
|
|
|
|
begin
|
2007-09-28 14:26:28 +02:00
|
|
|
|
Result := True;
|
2008-04-12 11:48:18 +02:00
|
|
|
|
|
|
|
|
|
{ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>⥬<EFBFBD> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
Event := kos_getevent();
|
|
|
|
|
case Event of
|
2008-04-12 11:48:18 +02:00
|
|
|
|
SE_PAINT : DoPaint; { <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD> }
|
|
|
|
|
SE_KEYBOARD: DoKey; { ᮡ<>⨥ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
|
|
|
|
SE_BUTTON : Result := DoButton; { ᮡ<EFBFBD>⨥ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> False }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 横<> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> }
|
|
|
|
|
var
|
|
|
|
|
ThreadSlot: TThreadSlot;
|
|
|
|
|
begin
|
2008-04-12 11:48:18 +02:00
|
|
|
|
{ <20><><EFBFBD><EFBFBD>ࠨ<EFBFBD><E0A0A8><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>⮢<EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> }
|
2007-09-12 18:34:21 +02:00
|
|
|
|
kos_maskevents(ME_PAINT or ME_KEYBOARD or ME_BUTTON);
|
|
|
|
|
|
2008-04-12 11:48:18 +02:00
|
|
|
|
{ <20><>ࠡ<EFBFBD>⪠ ᮡ<>⨩ }
|
|
|
|
|
while ProcessMessage do;
|
2007-09-12 18:34:21 +02:00
|
|
|
|
end.
|