1 | unit Dpi.Forms;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, LMessages, Controls, LCLType,
|
---|
7 | Generics.Collections, LCLProc, LResources, Graphics, Dpi.Controls,
|
---|
8 | Dpi.Graphics;
|
---|
9 |
|
---|
10 | const
|
---|
11 | crDefault = TCursor(0);
|
---|
12 |
|
---|
13 | type
|
---|
14 | TMessageEvent = procedure (var TheMessage : TLMessage) of object;
|
---|
15 | TCloseAction = Forms.TCloseAction;
|
---|
16 | TFormState = Forms.TFormState;
|
---|
17 | TFormStateType = Forms.TFormStateType;
|
---|
18 | TWindowState = Forms.TWindowState;
|
---|
19 | TScrollBarKind = Forms.TScrollBarKind;
|
---|
20 | TBorderIcon = Forms.TBorderIcon;
|
---|
21 | TShowInTaskbar = Forms.TShowInTaskbar;
|
---|
22 | TTaskBarBehavior = Forms.TTaskBarBehavior;
|
---|
23 |
|
---|
24 | { TFormEx }
|
---|
25 |
|
---|
26 | TFormEx = class(Forms.TForm)
|
---|
27 | private
|
---|
28 | FOnMessage: TMessageEvent;
|
---|
29 | protected
|
---|
30 | procedure WndProc(var TheMessage : TLMessage); override;
|
---|
31 | property OnMessage: TMessageEvent read FOnMessage write FOnMessage;
|
---|
32 | end;
|
---|
33 |
|
---|
34 | { TControlScrollBar }
|
---|
35 |
|
---|
36 | TControlScrollBar = class(TPersistent)
|
---|
37 | private
|
---|
38 | function GetVisible: Boolean;
|
---|
39 | procedure SetVisible(AValue: Boolean);
|
---|
40 | published
|
---|
41 | property Visible: Boolean read GetVisible write SetVisible;
|
---|
42 | end;
|
---|
43 |
|
---|
44 | { TScrollingWinControl }
|
---|
45 |
|
---|
46 | TScrollingWinControl = class(TCustomControl)
|
---|
47 | private
|
---|
48 | FHorzScrollBar: TControlScrollBar;
|
---|
49 | FVertScrollBar: TControlScrollBar;
|
---|
50 | protected
|
---|
51 | function GetNativeCustomControl: Controls.TCustomControl; override;
|
---|
52 | function GetNativeScrollingWinControl: Forms.TScrollingWinControl; virtual;
|
---|
53 | public
|
---|
54 | constructor Create(TheOwner: TComponent); override;
|
---|
55 | destructor Destroy; override;
|
---|
56 | published
|
---|
57 | property HorzScrollBar: TControlScrollBar read FHorzScrollBar write FHorzScrollBar;
|
---|
58 | property VertScrollBar: TControlScrollBar read FVertScrollBar write FVertScrollBar;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | { TForm }
|
---|
62 |
|
---|
63 | TForm = class(TScrollingWinControl)
|
---|
64 | private
|
---|
65 | FOnActivate: TNotifyEvent;
|
---|
66 | FOnClose: TCloseEvent;
|
---|
67 | FOnCloseQuery: TCloseQueryEvent;
|
---|
68 | FOnDeactivate: TNotifyEvent;
|
---|
69 | function GetBorderIcons: TBorderIcons;
|
---|
70 | function GetBorderStyle: TFormBorderStyle;
|
---|
71 | function GetDesignTimePPI: Integer;
|
---|
72 | function GetFormState: TFormState;
|
---|
73 | function GetFormStyle: TFormStyle;
|
---|
74 | function GetKeyPreview: Boolean;
|
---|
75 | function GetLCLVersion: string;
|
---|
76 | function GetModalResult: TModalResult;
|
---|
77 | function GetOnCloseQuery: TCloseQueryEvent;
|
---|
78 | function GetOnCreate: TNotifyEvent;
|
---|
79 | function GetOnDeactivate: TNotifyEvent;
|
---|
80 | function GetOnDestroy: TNotifyEvent;
|
---|
81 | function GetOnHide: TNotifyEvent;
|
---|
82 | function GetOnShow: TNotifyEvent;
|
---|
83 | function GetPosition: TPosition;
|
---|
84 | function GetRestoredHeight: Integer;
|
---|
85 | function GetRestoredLeft: Integer;
|
---|
86 | function GetRestoredTop: Integer;
|
---|
87 | function GetRestoredWidth: Integer;
|
---|
88 | function GetShowInTaskbar: TShowInTaskbar;
|
---|
89 | function GetWindowState: TWindowState;
|
---|
90 | procedure SetBorderIcons(AValue: TBorderIcons);
|
---|
91 | procedure SetBorderStyle(AValue: TFormBorderStyle);
|
---|
92 | procedure SetDesignTimePPI(AValue: Integer);
|
---|
93 | procedure SetFormStyle(AValue: TFormStyle);
|
---|
94 | procedure SetKeyPreview(AValue: Boolean);
|
---|
95 | procedure SetLCLVersion(AValue: string);
|
---|
96 | procedure SetModalResult(AValue: TModalResult);
|
---|
97 | procedure SetOnCloseQuery(AValue: TCloseQueryEvent);
|
---|
98 | procedure SetOnCreate(AValue: TNotifyEvent);
|
---|
99 | procedure SetOnDeactivate(AValue: TNotifyEvent);
|
---|
100 | procedure SetOnDestroy(AValue: TNotifyEvent);
|
---|
101 | procedure SetOnHide(AValue: TNotifyEvent);
|
---|
102 | procedure SetOnShow(AValue: TNotifyEvent);
|
---|
103 | procedure DoOnCreate;
|
---|
104 | procedure FormMessageHandler(var TheMessage: TLMessage);
|
---|
105 | procedure SetPosition(AValue: TPosition);
|
---|
106 | procedure SetShowInTaskBar(AValue: TShowInTaskbar);
|
---|
107 | procedure SetWindowState(AValue: TWindowState);
|
---|
108 | procedure ActivateHandler(Sender: TObject);
|
---|
109 | procedure DeactivateHandler(Sender: TObject);
|
---|
110 | procedure DoClose(var CloseAction: TCloseAction); virtual;
|
---|
111 | procedure CloseHandler(Sender: TObject; var CloseAction: TCloseAction);
|
---|
112 | procedure CloseQueryHandler(Sender : TObject; var CanClose : boolean);
|
---|
113 | protected
|
---|
114 | procedure CreateParams(var p: TCreateParams); virtual;
|
---|
115 | procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
---|
116 | function GetNativeScrollingWinControl: Forms.TScrollingWinControl; override;
|
---|
117 | function GetNativeForm: Forms.TForm; virtual;
|
---|
118 | procedure UpdateNativeControl; override;
|
---|
119 | public
|
---|
120 | NativeForm: Forms.TForm;
|
---|
121 | procedure AfterConstruction; override;
|
---|
122 | property ModalResult: TModalResult read GetModalResult write SetModalResult;
|
---|
123 | function ShowModal: Integer; virtual;
|
---|
124 | procedure SetFocus; override;
|
---|
125 | procedure Close;
|
---|
126 | function CloseQuery: boolean; virtual;
|
---|
127 | procedure BringToFront;
|
---|
128 | procedure Release;
|
---|
129 | constructor Create(TheOwner: TComponent); override;
|
---|
130 | constructor CreateNew(AOwner: TComponent; Num: Integer = 0); virtual;
|
---|
131 | destructor Destroy; override;
|
---|
132 | published
|
---|
133 | property RestoredLeft: integer read GetRestoredLeft;
|
---|
134 | property RestoredTop: integer read GetRestoredTop;
|
---|
135 | property RestoredWidth: integer read GetRestoredWidth;
|
---|
136 | property RestoredHeight: integer read GetRestoredHeight;
|
---|
137 | property DesignTimePPI: Integer read GetDesignTimePPI write SetDesignTimePPI; // Not used
|
---|
138 | property FormState: TFormState read GetFormState;
|
---|
139 | property FormStyle: TFormStyle read GetFormStyle write SetFormStyle;
|
---|
140 | property BorderStyle: TFormBorderStyle read GetBorderStyle write SetBorderStyle default bsSizeable;
|
---|
141 | property BorderIcons: TBorderIcons read GetBorderIcons write SetBorderIcons;
|
---|
142 | property LCLVersion: string read GetLCLVersion write SetLCLVersion;
|
---|
143 | property KeyPreview: Boolean read GetKeyPreview write SetKeyPreview default False;
|
---|
144 | property Position: TPosition read GetPosition write SetPosition default poDesigned;
|
---|
145 | property WindowState: TWindowState read GetWindowState write SetWindowState default wsNormal;
|
---|
146 | property OnShow: TNotifyEvent read GetOnShow write SetOnShow;
|
---|
147 | property OnHide: TNotifyEvent read GetOnHide write SetOnHide;
|
---|
148 | property OnCreate: TNotifyEvent read GetOnCreate write SetOnCreate;
|
---|
149 | property OnDestroy: TNotifyEvent read GetOnDestroy write SetOnDestroy;
|
---|
150 | property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
|
---|
151 | property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
|
---|
152 | property OnClose: TCloseEvent read FOnClose write FOnClose;
|
---|
153 | property OnCloseQuery: TCloseQueryEvent read FOnCloseQuery write FOnCloseQuery;
|
---|
154 | property ClientHeight;
|
---|
155 | property ClientWidth;
|
---|
156 | property OnMouseUp;
|
---|
157 | property OnMouseDown;
|
---|
158 | property OnMouseMove;
|
---|
159 | property ShowInTaskBar: TShowInTaskbar read GetShowInTaskbar write SetShowInTaskBar
|
---|
160 | default stDefault;
|
---|
161 | end;
|
---|
162 |
|
---|
163 | TForms = TObjectList<TForm>;
|
---|
164 |
|
---|
165 | { TApplication }
|
---|
166 |
|
---|
167 | TApplication = class(TComponent)
|
---|
168 | private
|
---|
169 | FMainForm: TForm;
|
---|
170 | FCreatingForm: TForm;
|
---|
171 | function GetActive: Boolean;
|
---|
172 | function GetExeName: string;
|
---|
173 | function GetShowMainForm: Boolean;
|
---|
174 | function GetTaskBarBehavior: TTaskBarBehavior;
|
---|
175 | function GetTitle: string;
|
---|
176 | procedure SetMainForm(AValue: TForm);
|
---|
177 | function GetMainForm: TForm;
|
---|
178 | procedure SetShowMainForm(AValue: Boolean);
|
---|
179 | procedure SetTaskBarBehavior(AValue: TTaskBarBehavior);
|
---|
180 | procedure SetTitle(AValue: string);
|
---|
181 | protected
|
---|
182 | function GetNativeApplication: Forms.TApplication; virtual;
|
---|
183 | procedure DoBeforeFinalization;
|
---|
184 | public
|
---|
185 | constructor Create(AOwner: TComponent); override;
|
---|
186 | destructor Destroy; override;
|
---|
187 | procedure Run;
|
---|
188 | procedure Initialize;
|
---|
189 | procedure Terminate;
|
---|
190 | procedure ProcessMessages;
|
---|
191 | procedure UpdateMainForm(AForm: TForm);
|
---|
192 | procedure CreateForm(InstanceClass: TComponentClass; out Reference);
|
---|
193 | procedure RemoveStayOnTop(const ASystemTopAlso: Boolean = False);
|
---|
194 | procedure RestoreStayOnTop(const ASystemTopAlso: Boolean = False);
|
---|
195 | function MessageBox(Text, Caption: PChar; Flags: Longint = MB_OK): Integer;
|
---|
196 | property MainForm: TForm read GetMainForm write SetMainForm;
|
---|
197 | property ShowMainForm: Boolean read GetShowMainForm write SetShowMainForm default True;
|
---|
198 | property Title: string read GetTitle write SetTitle;
|
---|
199 | property Active: Boolean read GetActive;
|
---|
200 | property ExeName: string read GetExeName;
|
---|
201 | property TaskBarBehavior: TTaskBarBehavior read GetTaskBarBehavior write SetTaskBarBehavior;
|
---|
202 | end;
|
---|
203 |
|
---|
204 | { TScreen }
|
---|
205 |
|
---|
206 | TScreen = class
|
---|
207 | private
|
---|
208 | FDpi: Integer;
|
---|
209 | FActiveForm: TForm;
|
---|
210 | FPrevActiveForms: TForms;
|
---|
211 | FForms: TForms;
|
---|
212 | procedure AddForm(AForm: TForm);
|
---|
213 | function GetDesktopHeight: Integer;
|
---|
214 | function GetDesktopLeft: Integer;
|
---|
215 | function GetDesktopTop: Integer;
|
---|
216 | function GetDesktopWidth: Integer;
|
---|
217 | procedure RemoveForm(AForm: TForm);
|
---|
218 | function GetActiveForm: TForm;
|
---|
219 | function GetCursor: TCursor;
|
---|
220 | function GetCursors(Index: Integer): HCURSOR;
|
---|
221 | function GetFormCount: Integer;
|
---|
222 | function GetForms(Index: Integer): TForm;
|
---|
223 | function GetHeight: Integer;
|
---|
224 | function GetWidth: Integer;
|
---|
225 | procedure SetCursor(AValue: TCursor);
|
---|
226 | procedure SetCursors(Index: Integer; AValue: HCURSOR);
|
---|
227 | procedure SetDpi(AValue: Integer);
|
---|
228 | procedure UpdateForms;
|
---|
229 | public
|
---|
230 | constructor Create;
|
---|
231 | destructor Destroy; override;
|
---|
232 | procedure UpdateActiveFormFromNativeScreen;
|
---|
233 | function DisableForms(SkipForm: TForm; DisabledList: Classes.TList = nil): Classes.TList;
|
---|
234 | procedure EnableForms(var AFormList: Classes.TList);
|
---|
235 | function GetSystemDpi: Integer;
|
---|
236 | property FormCount: Integer read GetFormCount;
|
---|
237 | property Forms[Index: Integer]: TForm read GetForms;
|
---|
238 | property ActiveForm: TForm read GetActiveForm;
|
---|
239 | property Cursor: TCursor read GetCursor write SetCursor;
|
---|
240 | property Cursors[Index: Integer]: HCURSOR read GetCursors write SetCursors;
|
---|
241 | published
|
---|
242 | property Dpi: Integer read FDpi write SetDpi;
|
---|
243 | property PixelsPerInch: Integer read FDpi;
|
---|
244 | property Width: Integer read GetWidth;
|
---|
245 | property Height: Integer read GetHeight;
|
---|
246 | property DesktopLeft: Integer read GetDesktopLeft;
|
---|
247 | property DesktopTop: Integer read GetDesktopTop;
|
---|
248 | property DesktopWidth: Integer read GetDesktopWidth;
|
---|
249 | property DesktopHeight: Integer read GetDesktopHeight;
|
---|
250 | end;
|
---|
251 |
|
---|
252 | var
|
---|
253 | Application: TApplication;
|
---|
254 | Screen: TScreen;
|
---|
255 |
|
---|
256 |
|
---|
257 | implementation
|
---|
258 |
|
---|
259 | uses
|
---|
260 | Dpi.Common;
|
---|
261 |
|
---|
262 | var
|
---|
263 | LCLScreen: Forms.TScreen absolute Forms.Screen;
|
---|
264 |
|
---|
265 | { TFormEx }
|
---|
266 |
|
---|
267 | procedure TFormEx.WndProc(var TheMessage: TLMessage);
|
---|
268 | begin
|
---|
269 | inherited WndProc(TheMessage);
|
---|
270 | if Assigned(FOnMessage) then
|
---|
271 | FOnMessage(TheMessage);
|
---|
272 | end;
|
---|
273 |
|
---|
274 | { TScrollingWinControl }
|
---|
275 |
|
---|
276 | function TScrollingWinControl.GetNativeCustomControl: Controls.TCustomControl;
|
---|
277 | begin
|
---|
278 | Result := GetNativeScrollingWinControl;
|
---|
279 | end;
|
---|
280 |
|
---|
281 | function TScrollingWinControl.GetNativeScrollingWinControl: Forms.TScrollingWinControl;
|
---|
282 | begin
|
---|
283 | Result := nil;
|
---|
284 | end;
|
---|
285 |
|
---|
286 | constructor TScrollingWinControl.Create(TheOwner: TComponent);
|
---|
287 | begin
|
---|
288 | inherited;
|
---|
289 | FHorzScrollBar := TControlScrollBar.Create;
|
---|
290 | FVertScrollBar := TControlScrollBar.Create;
|
---|
291 | end;
|
---|
292 |
|
---|
293 | destructor TScrollingWinControl.Destroy;
|
---|
294 | begin
|
---|
295 | FreeAndNil(FHorzScrollBar);
|
---|
296 | FreeAndNil(FVertScrollBar);
|
---|
297 | inherited;
|
---|
298 | end;
|
---|
299 |
|
---|
300 | { TApplication }
|
---|
301 |
|
---|
302 | procedure TApplication.SetMainForm(AValue: TForm);
|
---|
303 | begin
|
---|
304 | FMainForm := AValue;
|
---|
305 | end;
|
---|
306 |
|
---|
307 | function TApplication.GetTitle: string;
|
---|
308 | begin
|
---|
309 | Result := GetNativeApplication.Title;
|
---|
310 | end;
|
---|
311 |
|
---|
312 | function TApplication.GetShowMainForm: Boolean;
|
---|
313 | begin
|
---|
314 | Result := GetNativeApplication.ShowMainForm;
|
---|
315 | end;
|
---|
316 |
|
---|
317 | function TApplication.GetTaskBarBehavior: TTaskBarBehavior;
|
---|
318 | begin
|
---|
319 | Result := GetNativeApplication.TaskBarBehavior;
|
---|
320 | end;
|
---|
321 |
|
---|
322 | function TApplication.GetActive: Boolean;
|
---|
323 | begin
|
---|
324 | Result := GetNativeApplication.Active;
|
---|
325 | end;
|
---|
326 |
|
---|
327 | function TApplication.GetExeName: string;
|
---|
328 | begin
|
---|
329 | Result := GetNativeApplication.ExeName;
|
---|
330 | end;
|
---|
331 |
|
---|
332 | function TApplication.GetMainForm: TForm;
|
---|
333 | begin
|
---|
334 | Result := FMainForm;
|
---|
335 | end;
|
---|
336 |
|
---|
337 | procedure TApplication.SetShowMainForm(AValue: Boolean);
|
---|
338 | begin
|
---|
339 | GetNativeApplication.ShowMainForm := AValue;
|
---|
340 | end;
|
---|
341 |
|
---|
342 | procedure TApplication.SetTaskBarBehavior(AValue: TTaskBarBehavior);
|
---|
343 | begin
|
---|
344 | GetNativeApplication.TaskBarBehavior := AValue;
|
---|
345 | end;
|
---|
346 |
|
---|
347 | procedure TApplication.SetTitle(AValue: string);
|
---|
348 | begin
|
---|
349 | GetNativeApplication.Title := AValue;
|
---|
350 | end;
|
---|
351 |
|
---|
352 | function TApplication.GetNativeApplication: Forms.TApplication;
|
---|
353 | begin
|
---|
354 | Result := Forms.Application;
|
---|
355 | end;
|
---|
356 |
|
---|
357 | procedure DpiBeforeFinalization;
|
---|
358 | // This is our ExitProc handler.
|
---|
359 | begin
|
---|
360 | Application.DoBeforeFinalization;
|
---|
361 | end;
|
---|
362 |
|
---|
363 | procedure TApplication.DoBeforeFinalization;
|
---|
364 | var
|
---|
365 | I: Integer;
|
---|
366 | begin
|
---|
367 | if Self = nil then Exit;
|
---|
368 | for I := ComponentCount - 1 downto 0 do begin
|
---|
369 | if I < ComponentCount then
|
---|
370 | Components[I].Free;
|
---|
371 | end;
|
---|
372 | end;
|
---|
373 |
|
---|
374 | function DpiFindApplicationComponent(const ComponentName: string): TComponent;
|
---|
375 | // Note: this function is used by TReader to auto rename forms to unique names.
|
---|
376 | begin
|
---|
377 | Result := Application.FindComponent(ComponentName);
|
---|
378 | end;
|
---|
379 |
|
---|
380 | constructor TApplication.Create(AOwner: TComponent);
|
---|
381 | begin
|
---|
382 | RegisterFindGlobalComponentProc(@DpiFindApplicationComponent);
|
---|
383 | AddExitProc(@DpiBeforeFinalization);
|
---|
384 | inherited;
|
---|
385 | end;
|
---|
386 |
|
---|
387 | destructor TApplication.Destroy;
|
---|
388 | begin
|
---|
389 | UnregisterFindGlobalComponentProc(@DpiFindApplicationComponent);
|
---|
390 | inherited;
|
---|
391 | end;
|
---|
392 |
|
---|
393 | procedure TApplication.Run;
|
---|
394 | begin
|
---|
395 | if (FMainForm <> nil) and GetShowMainForm then FMainForm.Show;
|
---|
396 | GetNativeApplication.Run;
|
---|
397 | end;
|
---|
398 |
|
---|
399 | procedure TApplication.Initialize;
|
---|
400 | begin
|
---|
401 | GetNativeApplication.Initialize;
|
---|
402 | end;
|
---|
403 |
|
---|
404 | procedure TApplication.Terminate;
|
---|
405 | begin
|
---|
406 | GetNativeApplication.Terminate;
|
---|
407 | end;
|
---|
408 |
|
---|
409 | procedure TApplication.ProcessMessages;
|
---|
410 | begin
|
---|
411 | GetNativeApplication.ProcessMessages;
|
---|
412 | end;
|
---|
413 |
|
---|
414 | procedure TApplication.UpdateMainForm(AForm: TForm);
|
---|
415 | begin
|
---|
416 | if (FMainForm = nil)
|
---|
417 | and (FCreatingForm = AForm)
|
---|
418 | //and (not (AppDestroying in FFlags))
|
---|
419 | and not (AForm.FormStyle in [fsMDIChild, fsSplash])
|
---|
420 | then
|
---|
421 | FMainForm := AForm;
|
---|
422 | GetNativeApplication.UpdateMainForm(AForm.GetNativeForm);
|
---|
423 | end;
|
---|
424 |
|
---|
425 | procedure TApplication.CreateForm(InstanceClass: TComponentClass; out
|
---|
426 | Reference);
|
---|
427 | var
|
---|
428 | Instance: TComponent;
|
---|
429 | Ok: Boolean;
|
---|
430 | AForm: TForm;
|
---|
431 | begin
|
---|
432 | // Allocate the instance, without calling the constructor
|
---|
433 | Instance := TComponent(InstanceClass.NewInstance);
|
---|
434 | // set the Reference before the constructor is called, so that
|
---|
435 | // events and constructors can refer to it
|
---|
436 | TComponent(Reference) := Instance;
|
---|
437 |
|
---|
438 | Ok := False;
|
---|
439 | try
|
---|
440 | if (FCreatingForm = nil) and (Instance is TForm) then
|
---|
441 | FCreatingForm := TForm(Instance);
|
---|
442 | Instance.Create(Self);
|
---|
443 | Ok := True;
|
---|
444 | finally
|
---|
445 | if not Ok then begin
|
---|
446 | TComponent(Reference) := nil;
|
---|
447 | if FCreatingForm = Instance then
|
---|
448 | FCreatingForm := nil;
|
---|
449 | end;
|
---|
450 | end;
|
---|
451 |
|
---|
452 | if (Instance is TForm) then begin
|
---|
453 | AForm := TForm(Instance);
|
---|
454 | UpdateMainForm(AForm);
|
---|
455 | if FMainForm = AForm then AForm.GetNativeForm.HandleNeeded;
|
---|
456 | if AForm.FormStyle = fsSplash then begin
|
---|
457 | // show the splash form and handle the paint message
|
---|
458 | AForm.Show;
|
---|
459 | AForm.Invalidate;
|
---|
460 | ProcessMessages;
|
---|
461 | end;
|
---|
462 | end;
|
---|
463 | end;
|
---|
464 |
|
---|
465 | procedure TApplication.RemoveStayOnTop(const ASystemTopAlso: Boolean);
|
---|
466 | begin
|
---|
467 | GetNativeApplication.RemoveStayOnTop(ASystemTopAlso);
|
---|
468 | end;
|
---|
469 |
|
---|
470 | procedure TApplication.RestoreStayOnTop(const ASystemTopAlso: Boolean);
|
---|
471 | begin
|
---|
472 | GetNativeApplication.RestoreStayOnTop(ASystemTopAlso);
|
---|
473 | end;
|
---|
474 |
|
---|
475 | function TApplication.MessageBox(Text, Caption: PChar; Flags: Longint
|
---|
476 | ): Integer;
|
---|
477 | begin
|
---|
478 | Result := Application.MessageBox(Text, Caption, Flags);
|
---|
479 | end;
|
---|
480 |
|
---|
481 | { TForm }
|
---|
482 |
|
---|
483 | function TForm.GetBorderIcons: TBorderIcons;
|
---|
484 | begin
|
---|
485 | Result := GetNativeForm.BorderIcons;
|
---|
486 | end;
|
---|
487 |
|
---|
488 | function TForm.GetBorderStyle: TFormBorderStyle;
|
---|
489 | begin
|
---|
490 | Result := GetNativeForm.BorderStyle;
|
---|
491 | end;
|
---|
492 |
|
---|
493 | function TForm.GetDesignTimePPI: Integer;
|
---|
494 | begin
|
---|
495 | Result := GetNativeForm.DesignTimePPI;
|
---|
496 | end;
|
---|
497 |
|
---|
498 | function TForm.GetFormState: TFormState;
|
---|
499 | begin
|
---|
500 | Result := GetNativeForm.FormState;
|
---|
501 | end;
|
---|
502 |
|
---|
503 | function TForm.GetFormStyle: TFormStyle;
|
---|
504 | begin
|
---|
505 | Result := GetNativeForm.FormStyle;
|
---|
506 | end;
|
---|
507 |
|
---|
508 | function TForm.GetKeyPreview: Boolean;
|
---|
509 | begin
|
---|
510 | Result := GetNativeForm.KeyPreview;
|
---|
511 | end;
|
---|
512 |
|
---|
513 | function TForm.GetLCLVersion: string;
|
---|
514 | begin
|
---|
515 | Result := GetNativeForm.LCLVersion;
|
---|
516 | end;
|
---|
517 |
|
---|
518 | function TForm.GetModalResult: TModalResult;
|
---|
519 | begin
|
---|
520 | Result := GetNativeForm.ModalResult;
|
---|
521 | end;
|
---|
522 |
|
---|
523 | function TForm.GetOnCloseQuery: TCloseQueryEvent;
|
---|
524 | begin
|
---|
525 | Result := GetNativeForm.OnCloseQuery;
|
---|
526 | end;
|
---|
527 |
|
---|
528 | function TForm.GetOnCreate: TNotifyEvent;
|
---|
529 | begin
|
---|
530 | Result := GetNativeForm.OnCreate;
|
---|
531 | end;
|
---|
532 |
|
---|
533 | function TForm.GetOnDeactivate: TNotifyEvent;
|
---|
534 | begin
|
---|
535 | Result := GetNativeForm.OnDeactivate;
|
---|
536 | end;
|
---|
537 |
|
---|
538 | function TForm.GetOnDestroy: TNotifyEvent;
|
---|
539 | begin
|
---|
540 | Result := GetNativeForm.OnDestroy;
|
---|
541 | end;
|
---|
542 |
|
---|
543 | function TForm.GetOnHide: TNotifyEvent;
|
---|
544 | begin
|
---|
545 | Result := GetNativeForm.OnHide;
|
---|
546 | end;
|
---|
547 |
|
---|
548 | function TForm.GetOnShow: TNotifyEvent;
|
---|
549 | begin
|
---|
550 | Result := GetNativeForm.OnShow;
|
---|
551 | end;
|
---|
552 |
|
---|
553 | function TForm.GetPosition: TPosition;
|
---|
554 | begin
|
---|
555 | Result := GetNativeForm.Position;
|
---|
556 | end;
|
---|
557 |
|
---|
558 | function TForm.GetRestoredHeight: Integer;
|
---|
559 | begin
|
---|
560 | Result := ScaleFromNative(GetNativeForm.RestoredHeight);
|
---|
561 | end;
|
---|
562 |
|
---|
563 | function TForm.GetRestoredLeft: Integer;
|
---|
564 | begin
|
---|
565 | Result := ScaleFromNative(GetNativeForm.RestoredLeft);
|
---|
566 | end;
|
---|
567 |
|
---|
568 | function TForm.GetRestoredTop: Integer;
|
---|
569 | begin
|
---|
570 | Result := ScaleFromNative(GetNativeForm.RestoredTop);
|
---|
571 | end;
|
---|
572 |
|
---|
573 | function TForm.GetRestoredWidth: Integer;
|
---|
574 | begin
|
---|
575 | Result := ScaleFromNative(GetNativeForm.RestoredWidth);
|
---|
576 | end;
|
---|
577 |
|
---|
578 | function TForm.GetShowInTaskbar: TShowInTaskbar;
|
---|
579 | begin
|
---|
580 | Result := GetNativeForm.ShowInTaskBar;
|
---|
581 | end;
|
---|
582 |
|
---|
583 | function TForm.GetWindowState: TWindowState;
|
---|
584 | begin
|
---|
585 | Result := GetNativeForm.WindowState;
|
---|
586 | end;
|
---|
587 |
|
---|
588 | procedure TForm.SetBorderIcons(AValue: TBorderIcons);
|
---|
589 | begin
|
---|
590 | GetNativeForm.BorderIcons := AValue;
|
---|
591 | end;
|
---|
592 |
|
---|
593 | procedure TForm.SetBorderStyle(AValue: TFormBorderStyle);
|
---|
594 | begin
|
---|
595 | GetNativeForm.BorderStyle := AValue;
|
---|
596 | end;
|
---|
597 |
|
---|
598 | procedure TForm.SetDesignTimePPI(AValue: Integer);
|
---|
599 | begin
|
---|
600 | GetNativeForm.DesignTimePPI := AValue;
|
---|
601 | end;
|
---|
602 |
|
---|
603 | procedure TForm.SetFormStyle(AValue: TFormStyle);
|
---|
604 | begin
|
---|
605 | GetNativeForm.FormStyle := AValue;
|
---|
606 | end;
|
---|
607 |
|
---|
608 | procedure TForm.SetKeyPreview(AValue: Boolean);
|
---|
609 | begin
|
---|
610 | GetNativeForm.KeyPreview := AValue;
|
---|
611 | end;
|
---|
612 |
|
---|
613 | procedure TForm.SetLCLVersion(AValue: string);
|
---|
614 | begin
|
---|
615 | GetNativeForm.LCLVersion := AValue;
|
---|
616 | end;
|
---|
617 |
|
---|
618 | procedure TForm.SetModalResult(AValue: TModalResult);
|
---|
619 | begin
|
---|
620 | GetNativeForm.ModalResult := AValue;
|
---|
621 | end;
|
---|
622 |
|
---|
623 | procedure TForm.SetOnCloseQuery(AValue: TCloseQueryEvent);
|
---|
624 | begin
|
---|
625 | GetNativeForm.OnCloseQuery := AValue;
|
---|
626 | end;
|
---|
627 |
|
---|
628 | procedure TForm.SetOnCreate(AValue: TNotifyEvent);
|
---|
629 | begin
|
---|
630 | GetNativeForm.OnCreate := AValue;
|
---|
631 | end;
|
---|
632 |
|
---|
633 | procedure TForm.SetOnDeactivate(AValue: TNotifyEvent);
|
---|
634 | begin
|
---|
635 | GetNativeForm.OnDeactivate := AValue;
|
---|
636 | end;
|
---|
637 |
|
---|
638 | procedure TForm.SetOnDestroy(AValue: TNotifyEvent);
|
---|
639 | begin
|
---|
640 | GetNativeForm.OnDestroy := AValue;
|
---|
641 | end;
|
---|
642 |
|
---|
643 | procedure TForm.SetOnHide(AValue: TNotifyEvent);
|
---|
644 | begin
|
---|
645 | GetNativeForm.OnHide := AValue;
|
---|
646 | end;
|
---|
647 |
|
---|
648 | procedure TForm.SetOnShow(AValue: TNotifyEvent);
|
---|
649 | begin
|
---|
650 | GetNativeForm.OnShow := AValue;
|
---|
651 | end;
|
---|
652 |
|
---|
653 | procedure TForm.DoOnCreate;
|
---|
654 | begin
|
---|
655 | if Assigned(GetNativeForm.OnCreate) then
|
---|
656 | GetNativeForm.OnCreate(Self);
|
---|
657 | end;
|
---|
658 |
|
---|
659 | procedure TForm.FormMessageHandler(var TheMessage: TLMessage);
|
---|
660 | begin
|
---|
661 | Dispatch(TheMessage);
|
---|
662 | end;
|
---|
663 |
|
---|
664 | procedure TForm.SetPosition(AValue: TPosition);
|
---|
665 | begin
|
---|
666 | GetNativeForm.Position := AValue;
|
---|
667 | end;
|
---|
668 |
|
---|
669 | procedure TForm.SetShowInTaskBar(AValue: TShowInTaskbar);
|
---|
670 | begin
|
---|
671 | GetNativeForm.ShowInTaskBar := AValue;
|
---|
672 | end;
|
---|
673 |
|
---|
674 | procedure TForm.SetWindowState(AValue: TWindowState);
|
---|
675 | begin
|
---|
676 | GetNativeForm.WindowState := AValue;
|
---|
677 | end;
|
---|
678 |
|
---|
679 | procedure TForm.ActivateHandler(Sender: TObject);
|
---|
680 | begin
|
---|
681 | if Assigned(Screen.FActiveForm) then begin
|
---|
682 | if Screen.FPrevActiveForms.IndexOf(Screen.FActiveForm) <> - 1 then
|
---|
683 | Screen.FPrevActiveForms.Remove(Screen.FActiveForm);
|
---|
684 | Screen.FPrevActiveForms.Add(Screen.FActiveForm);
|
---|
685 | end;
|
---|
686 | Screen.FActiveForm := Self;
|
---|
687 | if Assigned(FOnActivate) then FOnActivate(Sender);
|
---|
688 | end;
|
---|
689 |
|
---|
690 | procedure TForm.DeactivateHandler(Sender: TObject);
|
---|
691 | begin
|
---|
692 | if Screen.FPrevActiveForms.Count > 0 then begin
|
---|
693 | Screen.FActiveForm := Screen.FPrevActiveForms.Last;
|
---|
694 | Screen.FPrevActiveForms.Delete(Screen.FPrevActiveForms.Count - 1);
|
---|
695 | end else Screen.FActiveForm := nil;
|
---|
696 | //Screen.UpdateActiveFormFromNativeScreen;
|
---|
697 | if Assigned(FOnDeactivate) then FOnDeactivate(Sender);
|
---|
698 | end;
|
---|
699 |
|
---|
700 | procedure TForm.DoClose(var CloseAction: TCloseAction);
|
---|
701 | begin
|
---|
702 | if Assigned(FOnClose) then FOnClose(Self, CloseAction);
|
---|
703 | end;
|
---|
704 |
|
---|
705 | procedure TForm.CloseHandler(Sender: TObject; var CloseAction: TCloseAction);
|
---|
706 | begin
|
---|
707 | Close;
|
---|
708 | end;
|
---|
709 |
|
---|
710 | procedure TForm.CloseQueryHandler(Sender : TObject; var CanClose : boolean);
|
---|
711 | begin
|
---|
712 | if Assigned(FOnCloseQuery) then FOnCloseQuery(Self, CanClose);
|
---|
713 | end;
|
---|
714 |
|
---|
715 | procedure TForm.CreateParams(var p: TCreateParams);
|
---|
716 | begin
|
---|
717 | // TODO: NativeForm.CreateParams(P);
|
---|
718 | end;
|
---|
719 |
|
---|
720 | // This method is called by TWriter to retrieve the child components to write
|
---|
721 | procedure TForm.GetChildren(Proc: TGetChildProc; Root: TComponent);
|
---|
722 | var
|
---|
723 | I: Integer;
|
---|
724 | OwnedComponent: TComponent;
|
---|
725 | begin
|
---|
726 | DebugLn(['TDpiForm.GetChildren ComponentCount=', ComponentCount]);
|
---|
727 | inherited GetChildren(Proc, Root);
|
---|
728 | if Root = Self then begin
|
---|
729 | for I := 0 to ComponentCount - 1 do begin
|
---|
730 | OwnedComponent := Components[I];
|
---|
731 | if not OwnedComponent.HasParent then Proc(OwnedComponent);
|
---|
732 | end;
|
---|
733 | end;
|
---|
734 | end;
|
---|
735 |
|
---|
736 | function TForm.GetNativeScrollingWinControl: Forms.TScrollingWinControl;
|
---|
737 | begin
|
---|
738 | Result := GetNativeForm;
|
---|
739 | end;
|
---|
740 |
|
---|
741 | function TForm.GetNativeForm: Forms.TForm;
|
---|
742 | begin
|
---|
743 | if not Assigned(NativeForm) then begin
|
---|
744 | NativeForm := TFormEx.CreateNew(nil);
|
---|
745 | (NativeForm as TFormEx).OnMessage := FormMessageHandler;
|
---|
746 | //NativeForm := Forms.TForm.Create(nil);
|
---|
747 | end;
|
---|
748 | Result := NativeForm;
|
---|
749 | end;
|
---|
750 |
|
---|
751 | procedure TForm.UpdateNativeControl;
|
---|
752 | begin
|
---|
753 | inherited;
|
---|
754 | GetNativeForm.OnActivate := ActivateHandler;
|
---|
755 | GetNativeForm.OnDeactivate := DeactivateHandler;
|
---|
756 | GetNativeForm.OnClose := CloseHandler;
|
---|
757 | GetNativeForm.OnCloseQuery := CloseQueryHandler;
|
---|
758 | GetNativeForm.Name := Name + 'Native';
|
---|
759 | end;
|
---|
760 |
|
---|
761 | procedure TForm.AfterConstruction;
|
---|
762 | begin
|
---|
763 | inherited;
|
---|
764 | DoOnCreate;
|
---|
765 | end;
|
---|
766 |
|
---|
767 | function TForm.ShowModal: Integer;
|
---|
768 | begin
|
---|
769 | Result := GetNativeForm.ShowModal;
|
---|
770 | end;
|
---|
771 |
|
---|
772 | procedure TForm.SetFocus;
|
---|
773 | begin
|
---|
774 | GetNativeForm.SetFocus;
|
---|
775 | end;
|
---|
776 |
|
---|
777 | procedure TForm.Close;
|
---|
778 | var
|
---|
779 | CloseAction: TCloseAction;
|
---|
780 | IsMainForm: Boolean;
|
---|
781 | begin
|
---|
782 | if (fsModal in FormState) and (ModalResult = 0) then
|
---|
783 | ModalResult := mrCancel
|
---|
784 | else
|
---|
785 | begin
|
---|
786 | if CloseQuery then
|
---|
787 | begin
|
---|
788 | // IsMainForm flag set if we are closing MainForm or its parent
|
---|
789 | IsMainForm := (Application.MainForm = Self) or (Self.IsParentOf(Application.MainForm));
|
---|
790 | // Prepare default close action
|
---|
791 | if FormStyle = fsMDIChild then
|
---|
792 | begin
|
---|
793 | CloseAction := caNone;
|
---|
794 | // TODO: mdi logic
|
---|
795 | end
|
---|
796 | else
|
---|
797 | begin
|
---|
798 | if IsMainForm then
|
---|
799 | CloseAction := caFree
|
---|
800 | else
|
---|
801 | CloseAction := caHide;
|
---|
802 | end;
|
---|
803 | // call event handler and let user modify CloseAction
|
---|
804 | DoClose(CloseAction);
|
---|
805 | // execute action according to close action
|
---|
806 | case CloseAction of
|
---|
807 | caHide: Hide;
|
---|
808 | caMinimize: WindowState := wsMinimized;
|
---|
809 | caFree:
|
---|
810 | begin
|
---|
811 | // if form is MainForm, then terminate the application
|
---|
812 | // the owner of the MainForm is the application,
|
---|
813 | // so the Application will take care of free-ing the form
|
---|
814 | // and Release is not necessary
|
---|
815 | if IsMainForm then
|
---|
816 | Application.Terminate
|
---|
817 | else
|
---|
818 | Release;
|
---|
819 | end;
|
---|
820 | end;
|
---|
821 | end;
|
---|
822 | end;
|
---|
823 | end;
|
---|
824 |
|
---|
825 | function TForm.CloseQuery: boolean;
|
---|
826 | begin
|
---|
827 | Result := True;
|
---|
828 | if Assigned(FOnCloseQuery) then
|
---|
829 | FOnCloseQuery(Self, Result);
|
---|
830 | end;
|
---|
831 |
|
---|
832 | procedure TForm.BringToFront;
|
---|
833 | begin
|
---|
834 | GetNativeForm.BringToFront;
|
---|
835 | end;
|
---|
836 |
|
---|
837 | procedure TForm.Release;
|
---|
838 | begin
|
---|
839 | Free;
|
---|
840 | end;
|
---|
841 |
|
---|
842 | // Init the component with an IDE resource
|
---|
843 | constructor TForm.Create(TheOwner: TComponent);
|
---|
844 | begin
|
---|
845 | //inherited;
|
---|
846 | //DebugLn(['TDpiForm.Create ', DbgSName(TheOwner)]);
|
---|
847 | GlobalNameSpace.BeginWrite;
|
---|
848 | try
|
---|
849 | CreateNew(TheOwner, 1); // this calls BeginFormUpdate, which is ended in AfterConstruction
|
---|
850 | if (ClassType <> TForm) and not (csDesigning in ComponentState) then begin
|
---|
851 | if not InitResourceComponent(Self, TDataModule) then begin
|
---|
852 | raise EResNotFound.Create('Resource missing for class ' + ClassName);
|
---|
853 | end;
|
---|
854 | end;
|
---|
855 | finally
|
---|
856 | GlobalNameSpace.EndWrite;
|
---|
857 | end;
|
---|
858 | ScreenChanged;
|
---|
859 | UpdateNativeControl;
|
---|
860 | end;
|
---|
861 |
|
---|
862 | constructor TForm.CreateNew(AOwner: TComponent; Num: Integer);
|
---|
863 | begin
|
---|
864 | inherited Create(AOwner);
|
---|
865 | Screen.AddForm(Self);
|
---|
866 | end;
|
---|
867 |
|
---|
868 | destructor TForm.Destroy;
|
---|
869 | begin
|
---|
870 | // TODO: Can't destroy directly?
|
---|
871 | TFormEx(NativeForm).OnMessage := nil;
|
---|
872 | FreeAndNil(NativeForm);
|
---|
873 |
|
---|
874 | Screen.RemoveForm(Self);
|
---|
875 | inherited;
|
---|
876 | end;
|
---|
877 |
|
---|
878 | { TScreen }
|
---|
879 |
|
---|
880 | procedure TScreen.SetDpi(AValue: Integer);
|
---|
881 | begin
|
---|
882 | if FDpi = AValue then Exit;
|
---|
883 | FDpi := AValue;
|
---|
884 | ScreenInfo.Dpi := Dpi;
|
---|
885 | UpdateForms;
|
---|
886 | end;
|
---|
887 |
|
---|
888 | function TScreen.GetWidth: Integer;
|
---|
889 | begin
|
---|
890 | Result := ScaleFromNative(LCLScreen.Width);
|
---|
891 | end;
|
---|
892 |
|
---|
893 | procedure TScreen.SetCursor(AValue: TCursor);
|
---|
894 | begin
|
---|
895 | LCLScreen.Cursor := AValue;
|
---|
896 | end;
|
---|
897 |
|
---|
898 | procedure TScreen.SetCursors(Index: Integer; AValue: HCURSOR);
|
---|
899 | begin
|
---|
900 | LCLScreen.Cursors[Index] := AValue;
|
---|
901 | end;
|
---|
902 |
|
---|
903 | function TScreen.GetHeight: Integer;
|
---|
904 | begin
|
---|
905 | Result := ScaleFromNative(LCLScreen.Height);
|
---|
906 | end;
|
---|
907 |
|
---|
908 | function TScreen.GetFormCount: Integer;
|
---|
909 | begin
|
---|
910 | Result := FForms.Count;
|
---|
911 | end;
|
---|
912 |
|
---|
913 | function TScreen.GetForms(Index: Integer): TForm;
|
---|
914 | begin
|
---|
915 | Result := FForms[Index];
|
---|
916 | end;
|
---|
917 |
|
---|
918 | procedure TScreen.AddForm(AForm: TForm);
|
---|
919 | begin
|
---|
920 | if AForm is TForm then begin
|
---|
921 | FForms.Add(AForm);
|
---|
922 | //Application.UpdateVisible;
|
---|
923 | end;
|
---|
924 | end;
|
---|
925 |
|
---|
926 | function TScreen.GetDesktopHeight: Integer;
|
---|
927 | begin
|
---|
928 | Result := ScaleFromNative(LCLScreen.DesktopHeight);
|
---|
929 | end;
|
---|
930 |
|
---|
931 | function TScreen.GetDesktopLeft: Integer;
|
---|
932 | begin
|
---|
933 | Result := ScaleFromNative(LCLScreen.DesktopLeft);
|
---|
934 | end;
|
---|
935 |
|
---|
936 | function TScreen.GetDesktopTop: Integer;
|
---|
937 | begin
|
---|
938 | Result := ScaleFromNative(LCLScreen.DesktopTop);
|
---|
939 | end;
|
---|
940 |
|
---|
941 | function TScreen.GetDesktopWidth: Integer;
|
---|
942 | begin
|
---|
943 | Result := ScaleFromNative(LCLScreen.DesktopWidth);
|
---|
944 | end;
|
---|
945 |
|
---|
946 | procedure TScreen.RemoveForm(AForm: TForm);
|
---|
947 | begin
|
---|
948 | FForms.Remove(AForm);
|
---|
949 | FPrevActiveForms.Remove(AForm);
|
---|
950 | if AForm = FActiveForm then begin
|
---|
951 | FActiveForm := nil;
|
---|
952 | end;
|
---|
953 | end;
|
---|
954 |
|
---|
955 | function TScreen.GetActiveForm: TForm;
|
---|
956 | begin
|
---|
957 | Result := FActiveForm;
|
---|
958 | end;
|
---|
959 |
|
---|
960 | function TScreen.GetCursor: TCursor;
|
---|
961 | begin
|
---|
962 | Result := LCLScreen.Cursor;
|
---|
963 | end;
|
---|
964 |
|
---|
965 | function TScreen.GetCursors(Index: Integer): HCURSOR;
|
---|
966 | begin
|
---|
967 | Result := LCLScreen.Cursors[Index];
|
---|
968 | end;
|
---|
969 |
|
---|
970 | procedure TScreen.UpdateForms;
|
---|
971 | var
|
---|
972 | I: Integer;
|
---|
973 | begin
|
---|
974 | for I := 0 to FForms.Count - 1 do
|
---|
975 | FForms[I].ScreenChanged;
|
---|
976 | end;
|
---|
977 |
|
---|
978 | function TScreen.DisableForms(SkipForm: TForm; DisabledList: Classes.TList
|
---|
979 | ): Classes.TList;
|
---|
980 | begin
|
---|
981 | Result := LCLScreen.DisableForms(SkipForm.GetNativeForm, DisabledList);
|
---|
982 | end;
|
---|
983 |
|
---|
984 | procedure TScreen.EnableForms(var AFormList: Classes.TList);
|
---|
985 | begin
|
---|
986 | LCLScreen.EnableForms(AFormList);
|
---|
987 | end;
|
---|
988 |
|
---|
989 | function TScreen.GetSystemDpi: Integer;
|
---|
990 | begin
|
---|
991 | Result := LCLScreen.PixelsPerInch;
|
---|
992 | end;
|
---|
993 |
|
---|
994 | constructor TScreen.Create;
|
---|
995 | begin
|
---|
996 | FForms := TForms.Create;
|
---|
997 | FForms.OwnsObjects := False;
|
---|
998 | FPrevActiveForms := TForms.Create;
|
---|
999 | FPrevActiveForms.OwnsObjects := False;
|
---|
1000 | // Froms.Screen.PixelsPerInch is not initialized at this point
|
---|
1001 | Dpi := 96;
|
---|
1002 | end;
|
---|
1003 |
|
---|
1004 | destructor TScreen.Destroy;
|
---|
1005 | begin
|
---|
1006 | FreeAndNil(FForms);
|
---|
1007 | FreeAndNil(FPrevActiveForms);
|
---|
1008 | inherited;
|
---|
1009 | end;
|
---|
1010 |
|
---|
1011 | procedure TScreen.UpdateActiveFormFromNativeScreen;
|
---|
1012 | var
|
---|
1013 | I: Integer;
|
---|
1014 | F: TForm;
|
---|
1015 | begin
|
---|
1016 | if LCLScreen.ActiveForm = nil then FActiveForm := nil
|
---|
1017 | else begin
|
---|
1018 | for I := 0 to FormCount - 1 do begin
|
---|
1019 | F := Forms[I];
|
---|
1020 | if F.GetNativeForm = LCLScreen.ActiveForm then begin
|
---|
1021 | FActiveForm := F;
|
---|
1022 | Break;
|
---|
1023 | end;
|
---|
1024 | end;
|
---|
1025 | end;
|
---|
1026 | end;
|
---|
1027 |
|
---|
1028 | { TControlScrollBar }
|
---|
1029 |
|
---|
1030 | function TControlScrollBar.GetVisible: Boolean;
|
---|
1031 | begin
|
---|
1032 |
|
---|
1033 | end;
|
---|
1034 |
|
---|
1035 | procedure TControlScrollBar.SetVisible(AValue: Boolean);
|
---|
1036 | begin
|
---|
1037 |
|
---|
1038 | end;
|
---|
1039 |
|
---|
1040 | initialization
|
---|
1041 |
|
---|
1042 | RegisterPropertyToSkip(TForm, 'OldCreateOrder', 'Native compatibility property', '');
|
---|
1043 | RegisterPropertyToSkip(TForm, 'TextHeight', 'Native compatibility property', '');
|
---|
1044 | RegisterPropertyToSkip(TForm, 'Scaled', 'Native compatibility property', '');
|
---|
1045 | RegisterPropertyToSkip(TForm, 'TransparentColorValue', 'Native compatibility property', '');
|
---|
1046 | Screen := TScreen.Create;
|
---|
1047 | Application := TApplication.Create(nil);
|
---|
1048 |
|
---|
1049 | finalization
|
---|
1050 |
|
---|
1051 | FreeAndNil(Application);
|
---|
1052 | FreeAndNil(Screen);
|
---|
1053 |
|
---|
1054 | end.
|
---|
1055 |
|
---|