unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
uniGUIClasses, uniGUIFrame, uniGUIBaseClasses, uniPanel;
type
TUniFrame2 = class(TUniFrame)
P: TUniContainerPanel;
SP: TUniSimplePanel;
private
{ Private declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{$R *.dfm}
constructor TUniFrame2.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
p.ClientEvents.ExtEvents.Values['afterlayout'] := 'function afterlayout(sender, layout, eOpts)'
+ ' {'
+ ' var PWidth = Ext.get("' + p.jsid + '").getWidth ();'
+ ' var PHegith = Ext.get("' + p.jsid + '").getHeight();'
+ ' var FWidth = Ext.get("' + SP.jsid + '").getWidth();'
+ ' var FHegith = Ext.get("' + SP.jsid + '").getHeight();'
+ ' var PLeft = FWidth / 2 - PWidth/2;'
+ ' var PTop = FHegith / 2 - PHegith/2;'
+ ' Ext.get("' + p.JSId + '").setStyle({"top":PTop + "px","left":PLeft + "px"});'
+'}';
end;
destructor TUniFrame2.Destroy;
begin
inherited Destroy;
end;
end.
object UniFrame2: TUniFrame2
Left = 0
Top = 0
Width = 472
Height = 355
Align = alClient
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 0
ExplicitWidth = 320
ExplicitHeight = 240
object SP: TUniSimplePanel
Left = 0
Top = 0
Width = 472
Height = 355
ParentColor = False
Align = alClient
TabOrder = 0
ExplicitLeft = 68
ExplicitTop = 181
ExplicitWidth = 256
ExplicitHeight = 128
object P: TUniContainerPanel
Left = 13
Top = 14
Width = 256
Height = 128
ParentColor = False
Color = 12615680
TabOrder = 1
end
end
end