Changeset 13 for trunk/Apps
- Timestamp:
- Sep 25, 2017, 2:48:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Apps/UClock.pas
r12 r13 6 6 7 7 uses 8 Classes, SysUtils, UApp, dateutils, UKernel, UScheduler, UIPC;8 SysUtils, UApp, dateutils, UKernel, UScheduler, UIPC, UGraphics; 9 9 10 10 type … … 32 32 Message: TIPCMessage; 33 33 WindowId: Integer; 34 CanvasId: Integer; 34 35 Angle: Double; 35 36 begin 36 37 Message := TIPCMessage.Create; 37 38 WindowId := API.WindowCreate; 38 API.WindowSetAttr(Point(300, 200), True); 39 CanvasId := API.GetWindowCanvas(WindowId); 40 API.WindowSetAttr(WindowId, TRectangle.Create(100, 50, 300, 200), True); 39 41 while not Task.Terminated do begin 40 42 API.WriteText('test'); 41 API.DrawRect( Rect(60, 60, 180, 180), $ffffff);42 API.DrawText( Point(10, 10), 'Text', 0);43 API.DrawRect(CanvasId, TRectangle.Create(60, 60, 180, 180), $ffffff); 44 API.DrawText(CanvasId, TPoint.Create(10, 10), 'Text', 0); 43 45 Angle := Frac(Now / (10 * OneSecond)) * 2 * Pi; 44 API.DrawLine( Point(120, 120), Point(Trunc(120 + Cos(Angle) * 60), Trunc(120 + Sin(Angle) * 60)), 0);46 API.DrawLine(CanvasId, TPoint.Create(120, 120), TPoint.Create(Trunc(120 + Cos(Angle) * 60), Trunc(120 + Sin(Angle) * 60)), 0); 45 47 API.Sleep(OneMillisecond * 10); 46 48 //API.ReadMessage(Message); … … 61 63 Message: TIPCMessage; 62 64 WindowId: Integer; 65 CanvasId: Integer; 63 66 Angle: Double; 64 67 begin 65 68 Message := TIPCMessage.Create; 66 69 WindowId := API.WindowCreate; 67 API.WindowSetAttr(Point(300, 200), True); 70 CanvasId := API.GetWindowCanvas(WindowId); 71 API.WindowSetAttr(WindowId, TRectangle.Create(100, 100, 300, 200), True); 68 72 while not Task.Terminated do begin 69 73 API.WriteText('test2'); 70 API.DrawRect( Rect(260, 160, 380, 280), $ffff80);71 API.DrawText( Point(210, 110), 'Text', 0);74 API.DrawRect(CanvasId, TRectangle.Create(460, 160, 380, 280), $ffff80); 75 API.DrawText(CanvasId, TPoint.Create(210, 110), 'Text', 0); 72 76 Angle := Frac(Now / (10 * OneSecond)) * 2 * Pi; 73 API.DrawLine( Point(320, 220), Point(Trunc(320 + Cos(Angle) * 60), Trunc(220 + Sin(Angle) * 60)), 0);77 API.DrawLine(CanvasId, TPoint.Create(320, 220), TPoint.Create(Trunc(320 + Cos(Angle) * 120), Trunc(220 + Sin(Angle) * 120)), 0); 74 78 API.Sleep(OneMillisecond * 300); 75 79 //API.ReadMessage(Message);
Note:
See TracChangeset
for help on using the changeset viewer.