|
@@ -98,9 +98,9 @@ type
|
|
|
property LayoutQueued: boolean read FLayoutQueued write SetLayoutQueued;
|
|
|
end;
|
|
|
|
|
|
- { TFresnelCustomForm }
|
|
|
+ { TOldFresnelCustomForm }
|
|
|
|
|
|
- TFresnelCustomForm = class(TCustomForm,IFresnelStreamRoot)
|
|
|
+ TOldFresnelCustomForm = class(TCustomForm,IFresnelStreamRoot)
|
|
|
private
|
|
|
FFontEngine: TFresnelLCLFontEngine;
|
|
|
FLayouter: TSimpleFresnelLayouter;
|
|
@@ -123,20 +123,157 @@ type
|
|
|
destructor Destroy; override;
|
|
|
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
|
|
property Viewport: TFresnelViewport read FViewport;
|
|
|
- property Layouter: TSimpleFresnelLayouter read FLayouter;
|
|
|
property FontEngine: TFresnelLCLFontEngine read FFontEngine;
|
|
|
+ property Layouter: TSimpleFresnelLayouter read FLayouter;
|
|
|
+ property LayoutQueued: boolean read FLayoutQueued write SetLayoutQueued;
|
|
|
property Renderer: TFresnelLCLRenderer read FRenderer;
|
|
|
property Stylesheet: TStrings read GetStylesheet write SetStylesheet;
|
|
|
+ end;
|
|
|
+
|
|
|
+ { TOldFresnelForm }
|
|
|
+
|
|
|
+ TOldFresnelForm = class(TOldFresnelCustomForm)
|
|
|
+ published
|
|
|
+ property Stylesheet;
|
|
|
+ end;
|
|
|
+
|
|
|
+ IFresnelFormDesigner = interface
|
|
|
+ ['{095CB7DD-E291-45B6-892E-F486A38E597C}']
|
|
|
+ procedure InvalidateRect(Sender: TObject; ARect: TRect; Erase: boolean);
|
|
|
+ procedure SetDesignerFormBounds(Sender: TObject; NewBounds: TRect);
|
|
|
+ function GetDesignerClientWidth: integer;
|
|
|
+ function GetDesignerClientHeight: integer;
|
|
|
+ end;
|
|
|
+
|
|
|
+ { TCustomFresnelForm }
|
|
|
+
|
|
|
+ TCustomFresnelForm = class(TFresnelViewport)
|
|
|
+ private
|
|
|
+ FCanvas: TCanvas;
|
|
|
+ FClearing: boolean;
|
|
|
+ FDesigner: IFresnelFormDesigner;
|
|
|
+ FFontEngineLCL: TFresnelLCLFontEngine;
|
|
|
+ FForm: TCustomForm;
|
|
|
+ FLayouter: TSimpleFresnelLayouter;
|
|
|
+ FLayoutQueued: boolean;
|
|
|
+ FRenderer: TFresnelLCLRenderer;
|
|
|
+ FVisible: boolean;
|
|
|
+ function GetAllowDropFiles: Boolean;
|
|
|
+ function GetAlphaBlend: Boolean;
|
|
|
+ function GetAlphaBlendValue: Byte;
|
|
|
+ function GetBorderIcons: TBorderIcons;
|
|
|
+ function GetCaption: TCaption;
|
|
|
+ function GetDefaultMonitor: TDefaultMonitor;
|
|
|
+ function GetEffectiveShowInTaskBar: TShowInTaskBar;
|
|
|
+ function GetFormBorderStyle: TFormBorderStyle;
|
|
|
+ function GetFormBoundsRect: TRect;
|
|
|
+ function GetFormHeight: integer;
|
|
|
+ function GetFormLeft: integer;
|
|
|
+ function GetFormState: TFormState;
|
|
|
+ function GetFormStyle: TFormStyle;
|
|
|
+ function GetFormTop: integer;
|
|
|
+ function GetFormWidth: integer;
|
|
|
+ function GetIcon: TIcon;
|
|
|
+ function GetPosition: TPosition;
|
|
|
+ function GetShowInTaskbar: TShowInTaskbar;
|
|
|
+ function GetVisible: boolean;
|
|
|
+ function GetWindowState: TWindowState;
|
|
|
+ function IsIconStored: Boolean;
|
|
|
+ procedure OnFormResize(Sender: TObject);
|
|
|
+ procedure SetAllowDropFiles(const AValue: Boolean);
|
|
|
+ procedure SetAlphaBlend(const AValue: Boolean);
|
|
|
+ procedure SetAlphaBlendValue(const AValue: Byte);
|
|
|
+ procedure SetBorderIcons(const AValue: TBorderIcons);
|
|
|
+ procedure SetCanvas(const AValue: TCanvas);
|
|
|
+ procedure SetCaption(const AValue: TCaption);
|
|
|
+ procedure SetDefaultMonitor(const AValue: TDefaultMonitor);
|
|
|
+ procedure SetFormBorderStyle(const AValue: TFormBorderStyle);
|
|
|
+ procedure SetFormBoundsRect(const AValue: TRect);
|
|
|
+ procedure SetFormHeight(const AValue: integer);
|
|
|
+ procedure SetFormLeft(const AValue: integer);
|
|
|
+ procedure SetFormStyle(const AValue: TFormStyle);
|
|
|
+ procedure SetFormTop(const AValue: integer);
|
|
|
+ procedure SetFormWidth(const AValue: integer);
|
|
|
+ procedure SetIcon(const AValue: TIcon);
|
|
|
+ procedure SetLayoutQueued(const AValue: boolean);
|
|
|
+ procedure SetPosition(const AValue: TPosition);
|
|
|
+ procedure SetShowInTaskBar(const AValue: TShowInTaskbar);
|
|
|
+ procedure SetVisible(const AValue: boolean);
|
|
|
+ procedure SetWindowState(const AValue: TWindowState);
|
|
|
+ function VisibleIsStored: Boolean;
|
|
|
+ protected
|
|
|
+ function GetHeight: TFresnelLength; override;
|
|
|
+ function GetWidth: TFresnelLength; override;
|
|
|
+ procedure FormPaint(Sender: TObject); virtual;
|
|
|
+ procedure Notification(AComponent: TComponent; Operation: TOperation);
|
|
|
+ override;
|
|
|
+ procedure OnQueuedLayout({%H-}Data: PtrInt); virtual;
|
|
|
+ procedure SetName(const NewName: TComponentName); override;
|
|
|
+ procedure SetHeight({%H-}AValue: TFresnelLength); override;
|
|
|
+ procedure SetWidth({%H-}AValue: TFresnelLength); override;
|
|
|
+ public
|
|
|
+ constructor Create(AOwner: TComponent); override;
|
|
|
+ destructor Destroy; override;
|
|
|
+ procedure DomChanged; override;
|
|
|
+ property AllowDropFiles: Boolean read GetAllowDropFiles write SetAllowDropFiles;
|
|
|
+ property AlphaBlend: Boolean read GetAlphaBlend write SetAlphaBlend;
|
|
|
+ property AlphaBlendValue: Byte read GetAlphaBlendValue write SetAlphaBlendValue;
|
|
|
+ property BorderIcons: TBorderIcons read GetBorderIcons write SetBorderIcons
|
|
|
+ default [biSystemMenu, biMinimize, biMaximize];
|
|
|
+ property BorderStyle: TFormBorderStyle
|
|
|
+ read GetFormBorderStyle write SetFormBorderStyle default bsSizeable;
|
|
|
+ property Canvas: TCanvas read FCanvas write SetCanvas;
|
|
|
+ property Caption: TCaption read GetCaption write SetCaption;
|
|
|
+ property DefaultMonitor: TDefaultMonitor read GetDefaultMonitor
|
|
|
+ write SetDefaultMonitor default dmActiveForm;
|
|
|
+ property Designer: IFresnelFormDesigner read FDesigner write FDesigner;
|
|
|
+ property EffectiveShowInTaskBar: TShowInTaskBar read GetEffectiveShowInTaskBar;
|
|
|
+ property FontEngineLCL: TFresnelLCLFontEngine read FFontEngineLCL;
|
|
|
+ property Form: TCustomForm read FForm;
|
|
|
+ property FormState: TFormState read GetFormState;
|
|
|
+ property FormStyle: TFormStyle read GetFormStyle write SetFormStyle default fsNormal;
|
|
|
+ property Icon: TIcon read GetIcon write SetIcon stored IsIconStored;
|
|
|
+ property Layouter: TSimpleFresnelLayouter read FLayouter;
|
|
|
property LayoutQueued: boolean read FLayoutQueued write SetLayoutQueued;
|
|
|
+ property Position: TPosition read GetPosition write SetPosition default poDesigned;
|
|
|
+ property Renderer: TFresnelLCLRenderer read FRenderer;
|
|
|
+ property ShowInTaskBar: TShowInTaskbar read GetShowInTaskbar write SetShowInTaskBar
|
|
|
+ default stDefault;
|
|
|
+ property Visible: boolean read GetVisible write SetVisible stored VisibleIsStored default false;
|
|
|
+ property WindowState: TWindowState read GetWindowState write SetWindowState
|
|
|
+ default wsNormal;
|
|
|
+ property FormBoundsRect: TRect read GetFormBoundsRect write SetFormBoundsRect;
|
|
|
+ property FormLeft: integer read GetFormLeft write SetFormLeft;
|
|
|
+ property FormTop: integer read GetFormTop write SetFormTop;
|
|
|
+ property FormWidth: integer read GetFormWidth write SetFormWidth;
|
|
|
+ property FormHeight: integer read GetFormHeight write SetFormHeight;
|
|
|
end;
|
|
|
|
|
|
{ TFresnelForm }
|
|
|
|
|
|
- TFresnelForm = class(TFresnelCustomForm)
|
|
|
+ TFresnelForm = class(TCustomFresnelForm)
|
|
|
published
|
|
|
+ property AllowDropFiles;
|
|
|
+ property AlphaBlend;
|
|
|
+ property AlphaBlendValue;
|
|
|
+ property BorderIcons;
|
|
|
+ property BorderStyle;
|
|
|
+ property Caption;
|
|
|
+ property DefaultMonitor;
|
|
|
+ property FormHeight;
|
|
|
+ property FormLeft;
|
|
|
+ property FormStyle;
|
|
|
+ property FormTop;
|
|
|
+ property FormWidth;
|
|
|
+ property Icon;
|
|
|
+ property Position;
|
|
|
+ property ShowInTaskBar;
|
|
|
property Stylesheet;
|
|
|
+ property Visible;
|
|
|
+ property WindowState;
|
|
|
end;
|
|
|
|
|
|
+
|
|
|
function CompareFresnelLCLFont(Item1, Item2: Pointer): integer;
|
|
|
function CompareFresnelFontDescWithLCLFont(Key, Item: Pointer): integer;
|
|
|
procedure FresnelRectToRect(const Src: TFresnelRect; out Dest: TRect);
|
|
@@ -191,6 +328,353 @@ begin
|
|
|
Dest.Bottom:=ceil(Src.Bottom);
|
|
|
end;
|
|
|
|
|
|
+{ TCustomFresnelForm }
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.DomChanged;
|
|
|
+begin
|
|
|
+ LayoutQueued:=true;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.OnQueuedLayout(Data: PtrInt);
|
|
|
+begin
|
|
|
+ ApplyCSS;
|
|
|
+ //Layouter.WriteLayoutTree;
|
|
|
+ Layouter.Apply(Self);
|
|
|
+ if Designer<>nil then
|
|
|
+ Designer.InvalidateRect(Self,Bounds(0,0,ceil(Width),ceil(Height)),false)
|
|
|
+ else
|
|
|
+ Form.Invalidate;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.FormPaint(Sender: TObject);
|
|
|
+begin
|
|
|
+ if Designer<>nil then exit;
|
|
|
+ Renderer.Draw(Self);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetLayoutQueued(const AValue: boolean);
|
|
|
+begin
|
|
|
+ if FLayoutQueued=AValue then Exit;
|
|
|
+ if FClearing then exit;
|
|
|
+ if csDestroyingHandle in Form.ControlState then exit;
|
|
|
+ if csDestroying in ComponentState then exit;
|
|
|
+ FLayoutQueued:=AValue;
|
|
|
+ if FLayoutQueued then
|
|
|
+ Application.QueueAsyncCall(@OnQueuedLayout,0);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetPosition(const AValue: TPosition);
|
|
|
+begin
|
|
|
+ Form.Position:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetShowInTaskBar(const AValue: TShowInTaskbar);
|
|
|
+begin
|
|
|
+ Form.ShowInTaskBar:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetVisible(const AValue: boolean);
|
|
|
+begin
|
|
|
+ if csDesigning in ComponentState then
|
|
|
+ FVisible:=AValue
|
|
|
+ else
|
|
|
+ Form.Visible:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetWindowState(const AValue: TWindowState);
|
|
|
+begin
|
|
|
+ Form.WindowState:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.VisibleIsStored: Boolean;
|
|
|
+begin
|
|
|
+ Result:=Visible;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetHeight: TFresnelLength;
|
|
|
+begin
|
|
|
+ if Designer<>nil then
|
|
|
+ Result:=Designer.GetDesignerClientHeight
|
|
|
+ else
|
|
|
+ Result:=Form.ClientHeight;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetWidth: TFresnelLength;
|
|
|
+begin
|
|
|
+ if Designer<>nil then
|
|
|
+ Result:=Designer.GetDesignerClientWidth
|
|
|
+ else
|
|
|
+ Result:=Form.ClientWidth;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetAllowDropFiles: Boolean;
|
|
|
+begin
|
|
|
+ Result:=Form.AllowDropFiles;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.OnFormResize(Sender: TObject);
|
|
|
+begin
|
|
|
+ inherited SetWidth(Form.ClientWidth);
|
|
|
+ inherited SetHeight(Form.ClientHeight);
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetAlphaBlend: Boolean;
|
|
|
+begin
|
|
|
+ Result:=Form.AlphaBlend;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetAlphaBlendValue: Byte;
|
|
|
+begin
|
|
|
+ Result:=Form.AlphaBlendValue;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetBorderIcons: TBorderIcons;
|
|
|
+begin
|
|
|
+ Result:=Form.BorderIcons;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetCaption: TCaption;
|
|
|
+begin
|
|
|
+ Result:=Form.Caption;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetDefaultMonitor: TDefaultMonitor;
|
|
|
+begin
|
|
|
+ Result:=Form.DefaultMonitor;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetEffectiveShowInTaskBar: TShowInTaskBar;
|
|
|
+begin
|
|
|
+ Result:=Form.EffectiveShowInTaskBar;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormBorderStyle: TFormBorderStyle;
|
|
|
+begin
|
|
|
+ Result:=Form.BorderStyle;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormBoundsRect: TRect;
|
|
|
+begin
|
|
|
+ Result:=Form.BoundsRect;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormHeight: integer;
|
|
|
+begin
|
|
|
+ Result:=Form.Height;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormLeft: integer;
|
|
|
+begin
|
|
|
+ Result:=Form.Left;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormState: TFormState;
|
|
|
+begin
|
|
|
+ Result:=Form.FormState;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormStyle: TFormStyle;
|
|
|
+begin
|
|
|
+ Result:=Form.FormStyle;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormTop: integer;
|
|
|
+begin
|
|
|
+ Result:=Form.Top;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetFormWidth: integer;
|
|
|
+begin
|
|
|
+ Result:=Form.Width;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetIcon: TIcon;
|
|
|
+begin
|
|
|
+ Result:=Form.Icon;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetPosition: TPosition;
|
|
|
+begin
|
|
|
+ Result:=Form.Position;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetShowInTaskbar: TShowInTaskbar;
|
|
|
+begin
|
|
|
+ Result:=Form.ShowInTaskBar;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetVisible: boolean;
|
|
|
+begin
|
|
|
+ if csDesigning in ComponentState then
|
|
|
+ Result:=FVisible
|
|
|
+ else
|
|
|
+ Result:=Form.Visible;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.GetWindowState: TWindowState;
|
|
|
+begin
|
|
|
+ Result:=Form.WindowState;
|
|
|
+end;
|
|
|
+
|
|
|
+function TCustomFresnelForm.IsIconStored: Boolean;
|
|
|
+begin
|
|
|
+ Result:=Icon<>nil;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetAllowDropFiles(const AValue: Boolean);
|
|
|
+begin
|
|
|
+ Form.AllowDropFiles:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetAlphaBlend(const AValue: Boolean);
|
|
|
+begin
|
|
|
+ Form.AlphaBlend:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetAlphaBlendValue(const AValue: Byte);
|
|
|
+begin
|
|
|
+ Form.AlphaBlendValue:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetBorderIcons(const AValue: TBorderIcons);
|
|
|
+begin
|
|
|
+ Form.BorderIcons:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetCanvas(const AValue: TCanvas);
|
|
|
+begin
|
|
|
+ if FCanvas=AValue then Exit;
|
|
|
+ FCanvas:=AValue;
|
|
|
+ FontEngineLCL.Canvas:=FCanvas;
|
|
|
+ Renderer.Canvas:=FCanvas;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetCaption(const AValue: TCaption);
|
|
|
+begin
|
|
|
+ Form.Caption:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetDefaultMonitor(const AValue: TDefaultMonitor);
|
|
|
+begin
|
|
|
+ Form.DefaultMonitor:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormBorderStyle(const AValue: TFormBorderStyle);
|
|
|
+begin
|
|
|
+ Form.BorderStyle:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormBoundsRect(const AValue: TRect);
|
|
|
+begin
|
|
|
+ Form.BoundsRect:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormHeight(const AValue: integer);
|
|
|
+begin
|
|
|
+ Form.Height:=AValue;
|
|
|
+ if Designer<>nil then
|
|
|
+ Designer.SetDesignerFormBounds(Self,Form.BoundsRect);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormLeft(const AValue: integer);
|
|
|
+begin
|
|
|
+ Form.Left:=AValue;
|
|
|
+ if Designer<>nil then
|
|
|
+ Designer.SetDesignerFormBounds(Self,Form.BoundsRect);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormStyle(const AValue: TFormStyle);
|
|
|
+begin
|
|
|
+ Form.FormStyle:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormTop(const AValue: integer);
|
|
|
+begin
|
|
|
+ Form.Top:=AValue;
|
|
|
+ if Designer<>nil then
|
|
|
+ Designer.SetDesignerFormBounds(Self,Form.BoundsRect);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetFormWidth(const AValue: integer);
|
|
|
+begin
|
|
|
+ Form.Width:=AValue;
|
|
|
+ if Designer<>nil then
|
|
|
+ Designer.SetDesignerFormBounds(Self,Form.BoundsRect);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetIcon(const AValue: TIcon);
|
|
|
+begin
|
|
|
+ Form.Icon:=AValue;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.Notification(AComponent: TComponent;
|
|
|
+ Operation: TOperation);
|
|
|
+begin
|
|
|
+ inherited Notification(AComponent, Operation);
|
|
|
+ if Operation=opRemove then
|
|
|
+ begin
|
|
|
+ if AComponent=FForm then
|
|
|
+ begin
|
|
|
+ FForm:=nil;
|
|
|
+ FCanvas:=nil;
|
|
|
+ end;
|
|
|
+ if AComponent=FFontEngineLCL then
|
|
|
+ FFontEngineLCL:=nil;
|
|
|
+ if AComponent=FRenderer then
|
|
|
+ FRenderer:=nil;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetName(const NewName: TComponentName);
|
|
|
+begin
|
|
|
+ inherited SetName(NewName);
|
|
|
+ Form.Name:=NewName;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetHeight(AValue: TFresnelLength);
|
|
|
+begin
|
|
|
+ raise Exception.Create('TCustomFresnelForm.SetHeight is a derived value, set FormHeight instead');
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TCustomFresnelForm.SetWidth(AValue: TFresnelLength);
|
|
|
+begin
|
|
|
+ raise Exception.Create('TCustomFresnelForm.SetWidth is a derived value, set FormWidth instead');
|
|
|
+end;
|
|
|
+
|
|
|
+constructor TCustomFresnelForm.Create(AOwner: TComponent);
|
|
|
+begin
|
|
|
+ inherited Create(AOwner);
|
|
|
+ FForm:=TCustomForm.CreateNew(nil);
|
|
|
+ FForm.Name:=Name;
|
|
|
+ FForm.Visible:=false;
|
|
|
+ FForm.OnResize:=@OnFormResize;
|
|
|
+ FCanvas:=Form.Canvas;
|
|
|
+ Form.OnPaint:=@FormPaint;
|
|
|
+
|
|
|
+ FFontEngineLCL:=TFresnelLCLFontEngine.Create(nil);
|
|
|
+ FontEngine:=FontEngineLCL;
|
|
|
+ FontEngineLCL.Canvas:=Canvas;
|
|
|
+
|
|
|
+ FLayouter:=TSimpleFresnelLayouter.Create(nil);
|
|
|
+ Layouter.Viewport:=Self;
|
|
|
+
|
|
|
+ FRenderer:=TFresnelLCLRenderer.Create(nil);
|
|
|
+ FRenderer.Canvas:=Canvas;
|
|
|
+end;
|
|
|
+
|
|
|
+destructor TCustomFresnelForm.Destroy;
|
|
|
+begin
|
|
|
+ FClearing:=true;
|
|
|
+ FreeAndNil(FRenderer);
|
|
|
+ FreeAndNil(FLayouter);
|
|
|
+ FontEngine:=nil;
|
|
|
+ FreeAndNil(FFontEngineLCL);
|
|
|
+ FCanvas:=nil;
|
|
|
+ FreeAndNil(FForm);
|
|
|
+ Application.RemoveAllHandlersOfObject(Self);
|
|
|
+ inherited Destroy;
|
|
|
+end;
|
|
|
+
|
|
|
{ TFresnelLCLRenderer }
|
|
|
|
|
|
procedure TFresnelLCLRenderer.FillRect(const aColor: TFPColor;
|
|
@@ -231,19 +715,19 @@ begin
|
|
|
inherited Create(AOwner);
|
|
|
end;
|
|
|
|
|
|
-{ TFresnelCustomForm }
|
|
|
+{ TOldFresnelCustomForm }
|
|
|
|
|
|
-function TFresnelCustomForm.GetStylesheet: TStrings;
|
|
|
+function TOldFresnelCustomForm.GetStylesheet: TStrings;
|
|
|
begin
|
|
|
Result:=Viewport.Stylesheet;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.OnDomChanged(Sender: TObject);
|
|
|
+procedure TOldFresnelCustomForm.OnDomChanged(Sender: TObject);
|
|
|
begin
|
|
|
LayoutQueued:=true;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.OnQueuedLayout(Data: PtrInt);
|
|
|
+procedure TOldFresnelCustomForm.OnQueuedLayout(Data: PtrInt);
|
|
|
begin
|
|
|
ViewPort.ApplyCSS;
|
|
|
//Layouter.WriteLayoutTree;
|
|
@@ -251,7 +735,7 @@ begin
|
|
|
Invalidate;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.SetLayoutQueued(const AValue: boolean);
|
|
|
+procedure TOldFresnelCustomForm.SetLayoutQueued(const AValue: boolean);
|
|
|
begin
|
|
|
if FLayoutQueued=AValue then Exit;
|
|
|
if FClearing then exit;
|
|
@@ -262,12 +746,12 @@ begin
|
|
|
Application.QueueAsyncCall(@OnQueuedLayout,0);
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.SetStylesheet(const AValue: TStrings);
|
|
|
+procedure TOldFresnelCustomForm.SetStylesheet(const AValue: TStrings);
|
|
|
begin
|
|
|
Viewport.Stylesheet:=AValue;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.Notification(AComponent: TComponent;
|
|
|
+procedure TOldFresnelCustomForm.Notification(AComponent: TComponent;
|
|
|
Operation: TOperation);
|
|
|
begin
|
|
|
inherited Notification(AComponent, Operation);
|
|
@@ -288,18 +772,18 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.Paint;
|
|
|
+procedure TOldFresnelCustomForm.Paint;
|
|
|
begin
|
|
|
inherited Paint;
|
|
|
Renderer.Draw(Viewport);
|
|
|
end;
|
|
|
|
|
|
-function TFresnelCustomForm.GetViewport: TFresnelViewport;
|
|
|
+function TOldFresnelCustomForm.GetViewport: TFresnelViewport;
|
|
|
begin
|
|
|
Result:=FViewport;
|
|
|
end;
|
|
|
|
|
|
-constructor TFresnelCustomForm.Create(AOwner: TComponent);
|
|
|
+constructor TOldFresnelCustomForm.Create(AOwner: TComponent);
|
|
|
begin
|
|
|
inherited Create(AOwner);
|
|
|
FViewport:=TFresnelViewport.Create(nil);
|
|
@@ -314,7 +798,7 @@ begin
|
|
|
FRenderer.Canvas:=Canvas;
|
|
|
end;
|
|
|
|
|
|
-destructor TFresnelCustomForm.Destroy;
|
|
|
+destructor TOldFresnelCustomForm.Destroy;
|
|
|
begin
|
|
|
FClearing:=true;
|
|
|
FreeAndNil(FRenderer);
|
|
@@ -325,7 +809,7 @@ begin
|
|
|
inherited Destroy;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelCustomForm.GetChildren(Proc: TGetChildProc; Root: TComponent);
|
|
|
+procedure TOldFresnelCustomForm.GetChildren(Proc: TGetChildProc; Root: TComponent);
|
|
|
var
|
|
|
i: Integer;
|
|
|
OwnedComponent: TComponent;
|