Class TXToolBar (unit XToolBar) |
Inherits from
TDockControl
constructor Create(aOwner : TComponent);
- Déclarations publiques
////////////////////////////// TXToolBar ////////////////////////////////////// { TXToolBar ------------ Public
destructor Destroy;
Its default value
procedure LoadPosition;
Ok warning
procedure NoticeVisibleChanged;
Set GroupsInfo
procedure RuntimeCreated;
procedure SavePosition;
Ok warning
procedure SetDock(aDock : TDocks);
Don't destroy DockCtrl : it's owned by DockForm Remove from Bar Chain
procedure SlaveControl(Master,Slave : TControl);
Suppose sizes OK
procedure UpdateInfo;
Reset size
procedure AlignControls(AControl: TControl; var Rect: TRect);
TXToolBar ------------ Protected
procedure CMShowingChanged(var Message: TMessage);
To set good showing attributesif ypos > Top+Height-5 then
procedure CMVisibleChanged(var Message: TMessage);
If not (csDesigning in ComponentState) then
procedure CreateParams(var params : TCreateParams);
updates info; size the window & arrange ctrlsSet fields and call events
procedure Loaded;
Déclarations protégées inc(cy,FControlHeight);
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure MouseMove(Shift: TShiftState; X, Y: Integer);
Add Client origin in Windows coord.
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Only now coz used by DrawMovRect
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
procedure SetParent(aParent : TWinControl);
Recalc pos/size
procedure WMActivate(var Msg : TWMActivate);
procedure WMClose(var Msg : TMessage);
procedure WMMouseActivate(var Msg : TWMMouseActivate);
Doesn't show inactive title if toolbar is activated
procedure WMNCActivate(var Msg : TWMNCActivate);
procedure WMNCHitTest(var Msg : TWMNCHitTest);
Used when moving the win
procedure WMNCLButtonDown(var msg : TWMNCLButtonDown);
Updates FloatSize & arrange ctrls
procedure WMSize(var Msg : TWMSize);
Hides the win instead of closing & destroying it
procedure AutoResize;
Draw the move frame w/ oldrect
procedure CheckMsg(var message : TMessage);
Get min clientsize
class function ControlInForm(Control,Form : TControl) : Boolean;
or WS_EX_TRANSPARENT; //bugged!! :(
procedure DrawControls;
True if saved
procedure DrawMovRect;
Little procsUpdateSizes; arg! call it if you wanna deadlock! and there is no need to call it!
procedure GetMinSize(var W,H : integer);
Resizes the bar to fit controls
Function SavedToRegistry : boolean;
Shows the bar - Prehaps this would cause problem w/ combo boxes
procedure SetAllowDock(aAllow : TUsedPos);
TXToolBar -------- Private
procedure SetDockLine(Value: Integer);
Sets Dockareas
procedure SetDockParams(LineTo, PosTo : integer);
procedure SetDockPos(Value: Integer);
procedure SwitchSlave;
We're vertical, so Master is in fact slave
procedure UpdateDockLine;
procedure UpdateDockPos;
procedure UpdateSizes;
property AllowedDock : TUsedPos
Déclarations publiées
property AutoSavePosition : boolean
property Caption :
property Color :
property DockBase : TDocks
property DockedTo : TDocks
property DockLine : Integer
property DockPos : Integer
property ParentColor :
property ParentShowHint :
property PopupMenu :
property RegistryKey : string
property ShowHint :
property Visible :
event OnDockChanged : TNotifyEvent
event OnDragDrop :
event OnDragOver :
event OnVerticalDock : TVDockEvent
event OnVisibleChanged : TNotifyEvent
AcceptSizes : TAcceptSizes;
Info on groups
CurSizeID : integer;
Docking : Boolean;
The move frame is drawn
FakeDocking : Boolean;
FAllowDock : TUsedPos;
Possible sizes of floating win
FAutoSave : Boolean;
True if the bar is ready to be loaded from the registry
FDockBase : TDocks;
FDockedTo : TDocks;
FDockForm : TForm;
Autres
FDockingTo : TDocks;
FDockLine : integer;
for internal use, equivalent to FDockLine
FDockPos : integer;
FDockPt : TPoint;
FDocks : TList;
Allowed directions of docking
FDown : Boolean;
Flag true when changing parent window
FFloatHeight : integer;
FFloatPos : TPoint;
FFloatWidth : integer;
FHWidth : integer;
Size of floating window
FloatParent : TFloatBarParent;
What form to dock on (MDI Parent form
FMoving : Boolean;
FOnDockChanged : TNotifyEvent;
FOnVDock : TVDockEvent;
FOnVisibleChanged : TNotifyEvent;
FRegKey : string;
Déclarations privées } {Evénements
FSizing : integer;
Form where the win is dragged - Bar relative Also used to give new pos to SetDock - absolute
FSuppDockLine : Integer;
FSuppDockPos : Integer;
FUpdatingBounds : Boolean;
Desktop DC; for move frame
FVHeight : integer;
Size when docked horz
GroupsInfo : TGroupsInfo;
Total nbr of btn groups
MovPos : TPoint;
absolute pos of floating win
NAcceptSizes : integer;
vert
NextBar : TXToolBar;
NGroups : integer;
Nbr of possible sizes for the win
Old : Pointer;
OldRect : TRect;
Button down?
PrevBar : TXToolBar;
Ready2Load : Boolean;
True at the end of loaded method
ScrDC : HDC;
ShowActive : Boolean;
<=> vertical controls are shown
SlaveInfo : TList;
Possible dock places
SlaveVertical : Boolean;
auto Save & Load position
WinRect : TRect;
XLoaded : Boolean;
If true, a docking will place the bar at the dockpos/dockline instead of dockpt.
constructor Create(aOwner : TComponent);
Déclarations publiques
////////////////////////////// TXToolBar ////////////////////////////////////// { TXToolBar ------------ Public
destructor Destroy;
Its default value
procedure LoadPosition;
Ok warning
procedure NoticeVisibleChanged;
Set GroupsInfo
procedure RuntimeCreated;
procedure SavePosition;
Ok warning
procedure SetDock(aDock : TDocks);
Don't destroy DockCtrl : it's owned by DockForm Remove from Bar Chain
procedure SlaveControl(Master,Slave : TControl);
Suppose sizes OK
procedure UpdateInfo;
Reset size
procedure AlignControls(AControl: TControl; var Rect: TRect);
TXToolBar ------------ Protected
procedure CMShowingChanged(var Message: TMessage);
To set good showing attributes
if ypos > Top+Height-5 then
procedure CMVisibleChanged(var Message: TMessage);
If not (csDesigning in ComponentState) then
procedure CreateParams(var params : TCreateParams);
updates info; size the window & arrange ctrls
Set fields and call events
procedure Loaded;
Déclarations protégées
inc(cy,FControlHeight);
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure MouseMove(Shift: TShiftState; X, Y: Integer);
Add Client origin in Windows coord.
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Only now coz used by DrawMovRect
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
procedure SetParent(aParent : TWinControl);
Recalc pos/size
procedure WMActivate(var Msg : TWMActivate);
procedure WMClose(var Msg : TMessage);
procedure WMMouseActivate(var Msg : TWMMouseActivate);
Doesn't show inactive title if toolbar is activated
procedure WMNCActivate(var Msg : TWMNCActivate);
procedure WMNCHitTest(var Msg : TWMNCHitTest);
Used when moving the win
procedure WMNCLButtonDown(var msg : TWMNCLButtonDown);
Updates FloatSize & arrange ctrls
procedure WMSize(var Msg : TWMSize);
Hides the win instead of closing & destroying it
procedure AutoResize;
Draw the move frame w/ oldrect
procedure CheckMsg(var message : TMessage);
Get min clientsize
class function ControlInForm(Control,Form : TControl) : Boolean;
or WS_EX_TRANSPARENT; //bugged!! :(
procedure DrawControls;
True if saved
procedure DrawMovRect;
Little procs
UpdateSizes; arg! call it if you wanna deadlock! and there is no need to call it!
procedure GetMinSize(var W,H : integer);
Resizes the bar to fit controls
Function SavedToRegistry : boolean;
Shows the bar - Prehaps this would cause problem w/ combo boxes
procedure SetAllowDock(aAllow : TUsedPos);
TXToolBar -------- Private
procedure SetDockLine(Value: Integer);
Sets Dockareas
procedure SetDockParams(LineTo, PosTo : integer);
procedure SetDockPos(Value: Integer);
procedure SwitchSlave;
We're vertical, so Master is in fact slave
procedure UpdateDockLine;
procedure UpdateDockPos;
procedure UpdateSizes;
property AllowedDock : TUsedPos
Déclarations publiées
property AutoSavePosition : boolean
property Caption :
property Color :
property DockBase : TDocks
property DockedTo : TDocks
property DockLine : Integer
property DockPos : Integer
property ParentColor :
property ParentShowHint :
property PopupMenu :
property RegistryKey : string
property ShowHint :
property Visible :
event OnDockChanged : TNotifyEvent
event OnDragDrop :
event OnDragOver :
event OnVerticalDock : TVDockEvent
event OnVisibleChanged : TNotifyEvent
AcceptSizes : TAcceptSizes;
Info on groups
CurSizeID : integer;
Docking : Boolean;
The move frame is drawn
FakeDocking : Boolean;
FAllowDock : TUsedPos;
Possible sizes of floating win
FAutoSave : Boolean;
True if the bar is ready to be loaded from the registry
FDockBase : TDocks;
FDockedTo : TDocks;
FDockForm : TForm;
Autres
FDockingTo : TDocks;
FDockLine : integer;
for internal use, equivalent to FDockLine
FDockPos : integer;
FDockPt : TPoint;
FDocks : TList;
Allowed directions of docking
FDown : Boolean;
Flag true when changing parent window
FFloatHeight : integer;
FFloatPos : TPoint;
FFloatWidth : integer;
FHWidth : integer;
Size of floating window
FloatParent : TFloatBarParent;
What form to dock on (MDI Parent form
FMoving : Boolean;
FOnDockChanged : TNotifyEvent;
FOnVDock : TVDockEvent;
FOnVisibleChanged : TNotifyEvent;
FRegKey : string;
Déclarations privées } {Evénements
FSizing : integer;
Form where the win is dragged - Bar relative Also used to give new pos to SetDock - absolute
FSuppDockLine : Integer;
FSuppDockPos : Integer;
FUpdatingBounds : Boolean;
Desktop DC; for move frame
FVHeight : integer;
Size when docked horz
GroupsInfo : TGroupsInfo;
Total nbr of btn groups
MovPos : TPoint;
absolute pos of floating win
NAcceptSizes : integer;
vert
NextBar : TXToolBar;
NGroups : integer;
Nbr of possible sizes for the win
Old : Pointer;
OldRect : TRect;
Button down?
PrevBar : TXToolBar;
Ready2Load : Boolean;
True at the end of loaded method
ScrDC : HDC;
ShowActive : Boolean;
<=> vertical controls are shown
SlaveInfo : TList;
Possible dock places
SlaveVertical : Boolean;
auto Save & Load position
WinRect : TRect;
XLoaded : Boolean;
If true, a docking will place the bar at the dockpos/dockline instead of dockpt.