Changeset 22 for branches/overos/UFormMain.pas
- Timestamp:
- Dec 30, 2018, 1:01:14 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/overos/UFormMain.pas
r21 r22 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UWindow, USystem, UTypes, UMouse, UGraphics, UControls;9 Types, UWindow, USystem, UTypes, UMouse, UGraphics, UControls, UApplication; 10 10 11 11 type … … 16 16 TFormMain = class(TForm) 17 17 Image1: TImage; 18 Timer1: TTimer; 18 19 procedure Image1MouseDown(Sender: TObject; Button: TControlsMouseButton; 19 20 Shift: TShiftState; X, Y: Integer); … … 23 24 procedure FormResize(Sender: TObject); 24 25 procedure FormShow(Sender: TObject); 26 procedure Timer1Timer(Sender: TObject); 25 27 private 26 28 27 29 public 30 App: TApplication; 28 31 System: TSystem; 29 32 end; … … 36 39 procedure DrawArea(Rect: TRectangle; Color: TColor); override; 37 40 procedure DrawText(P: TPosition; Color: TColor; Text: string); override; 41 function GetTextSize(Text: string): TSize; override; 38 42 end; 39 43 … … 66 70 procedure TCanvasScreen.DrawText(P: TPosition; Color: TColor; Text: string); 67 71 begin 72 Canvas.Brush.Style := bsClear; 68 73 Canvas.Font.Color := Color; 69 74 Canvas.TextOut(P.Left, P.Top, Text); 75 end; 76 77 function TCanvasScreen.GetTextSize(Text: string): TSize; 78 var 79 Size: Types.TSize; 80 begin 81 Size := Canvas.TextExtent(Text); 82 Result := TSize.Create(Size.cx, Size.cy); 70 83 end; 71 84 … … 125 138 System.Screen.Size := TSize.Create(Width, Height); 126 139 140 App := TApplication.Create; 141 127 142 Window := System.Screen.CreateWindow('Test'); 143 Window.Application := App; 128 144 129 145 Window := System.Screen.CreateWindow('Commander'); 130 Window.Rectangle.Position := TPosition.Create(100, 50); 131 Window.Rectangle.Size := TSize.Create(400, 200); 146 Window.Position := TPosition.Create(100, 50); 147 Window.Size := TSize.Create(400, 200); 148 Window.Application := App; 132 149 Button := TButton.Create; 133 150 Button.Rectangle := TRectangle.Create(TPosition.Create(10, 50), TSize.Create(100, 32)); … … 137 154 138 155 Window := System.Screen.CreateWindow('Calculator'); 139 Window.Rectangle.Position := TPosition.Create(200, 100); 140 Window.Rectangle.Size := TSize.Create(300, 200); 156 Window.Application := App; 157 Window.Position := TPosition.Create(200, 100); 158 Window.Size := TSize.Create(300, 200); 141 159 142 160 System.Screen.Paint; 143 161 end; 144 162 163 procedure TFormMain.Timer1Timer(Sender: TObject); 164 begin 165 App.ProcessMessages; 166 end; 167 145 168 end. 146 169
Note:
See TracChangeset
for help on using the changeset viewer.