[Overview][Constants][Types][Classes][Procedures and functions][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
TToolbar manages tool buttons and other controls, arranging them in rows and automatically adjusting their sizes and positions.
Source position: comctrls.pp line 1486
type TToolBar = class(TToolWindow) |
||
protected |
||
procedure AdjustClientRect(); override; |
|
AdjustClientRect - method for adjusting the size and position of the client control |
function GetControlClassDefaultSize; override; |
|
Find the default size for this class of controls (by reference to parents) |
function CanAutoSize(); override; |
|
Function to determine if autosizing is possible, and if so, gets the new width and height |
procedure CalculatePreferredSize(); override; |
|
CalculatePreferredSize - find default/preferred height and width |
function CheckMenuDropdown(); dynamic; |
|
CheckMenuDropdown - returns True if there is a checked dropdown menu |
procedure ClickButton(); dynamic; |
|
ClickButton - software emulation of the OnClick event |
procedure CreateParams(); override; |
|
CreateParams - create parameters for this windowed class |
procedure CreateWnd; override; |
|
Creates the Window |
procedure ControlsAligned; override; |
|
ControlsAligned - called by AlignControls after aligning controls |
function FindButtonFromAccel(); |
|
FindButtonFromAccel - returns the Button corresponding to the specified accelerator key |
procedure FontChanged(); override; |
|
FontChanged - method to cope with change in font |
procedure ParentFontChanged; override; |
|
ParentFontChanged - method for coping with change in parent font |
procedure Loaded; override; |
|
|
procedure Notification(); override; |
|
|
procedure RepositionButton(); |
|
RepositionButton - method for re-positioning a button |
procedure RepositionButtons(); |
|
RepositionButtons - method for re-positioning several buttons |
function WrapButtons(); |
|
WrapButtons - returns True if changing to NewHeight and NewWidth causes wrapping of buttons |
public |
||
constructor Create(); override; |
|
|
destructor Destroy; override; |
|
|
procedure FlipChildren(); override; |
|
FlipChildren - reverse the order of the child components |
procedure BeginUpdate; virtual; |
|
BeginUpdate - starts the update process |
procedure EndUpdate; virtual; |
|
EndUpdate - finishes the update process |
procedure Paint; override; |
|
The default paint handler for the class |
procedure SetButtonSize(); |
|
SetButtonSize - stores new values for height and width |
function CanFocus; override; |
|
CanFocus - is the current window allowed to receive focus? |
property ButtonCount: Integer; [r] |
|
ButtonCount - the number of buttons on the ToolBar |
property Buttons: TToolButton; [r] |
|
Lists the tool buttons (TToolButton) in the toolbar. |
property ButtonList: TList; [r] |
|
ButtonList - the list of Buttons (as a TList) |
property RowCount: Integer; [r] |
|
RowCount - the number of Rows of Buttons |
published |
||
property Align; |
|
Used to align the control in one of four directions. |
property AutoSize; |
|
Whether auto-size is to be used |
property BorderSpacing; |
|
Determines the border spacing for this control |
property BorderWidth; |
|
Property to determine width of the window's border |
property ButtonHeight: Integer; [rw] |
|
ButtonHeight - the height of the buttons |
property ButtonWidth: Integer; [rw] |
|
ButtonWidth - the width of the buttons |
property Caption; |
|
Caption - the text-string appearing on the Control, usually used to identify its function |
property ChildSizing; |
|
Definitions of how any child control is to be sized |
property Constraints; |
|
Determine Constraints (max and min height and width) for this control |
property Color; |
|
Determine the colour for the current control |
property Ctl3D; |
|
Ctl3D - retained for Delphi compatibility; even there it is deprecated |
property DisabledImages: TCustomImageList; [rw] |
|
The Images on the Image List that are NOT selected for display |
property DragCursor; |
|
DragCursor - the style of cursor to be used during the Drag process |
property DragKind; |
|
DragKind - what sort of dragging? Drag or Dock |
property DragMode; |
|
DragMode - whether manual or automatic |
property EdgeBorders; |
|
EdgeBorders - which borders form th eedge |
property EdgeInner; |
|
EdgeInner - this toolbar has an inner edge |
property EdgeOuter; |
|
EdgeOuter - this toolbar has an outer edge |
property Enabled; |
|
Whether the control is Enabled. If not, it usually appears 'greyed-out' |
property Flat: Boolean; [rw] |
|
Should the toolbuttons be displayed Flat (rather than in relief)? Default false |
property Font; |
|
The Font to be used for text in this control |
property Height; |
|
Height - the vertical dimension of the control |
property HotImages: TCustomImageList; [rw] |
|
The Images on the Image list that are selected for display |
property Images: TCustomImageList; [rw] |
|
The Images to be displayed on the buttons |
property Indent: Integer; [rw] |
|
Indent - the amount by which the buttons should be indented Default is 1 |
property List: Boolean; [rw] |
|
Should the contents of the toolbar be displayed as a List? Default false |
property ParentColor; |
|
ParentColor - should the control have the same colour as the parent? Default is true |
property ParentFont; |
|
ParentFont - should the control use the same font as the parent? Default is true |
property ParentShowHint; |
|
ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true |
property PopupMenu; |
|
PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control |
property ShowCaptions: Boolean; [rw] |
|
ShowCaptions - should the captions be shown for the buttons? (Default False) |
property ShowHint; |
|
Flag to determine: Is hint to be displayed for this control? |
property TabOrder; |
|
The place this control occupies in the list of tabs |
property TabStop; |
|
Is the control in the sequence of controls accessed by successive presses of the Tab key? |
property Transparent: Boolean; [rw] |
|
Is the ToolBar to be Transparent? Default False |
property Visible; |
|
Visible - can the control be seen? |
property Wrapable: Boolean; [rw] |
|
Wrapable - enables wrapping buttons to the next row if there are too many for the current row |
property OnClick; |
|
Event Handler for mouse click |
property OnContextPopup; |
|
Event handler to supply information when a context-sensitive pop-up menu is required |
property OnDblClick; |
|
Event Handle for mouse double-click |
property OnDragDrop; |
|
Event handler for the Drag-Drop manoeuvre |
property OnDragOver; |
|
Event handler for the case when a control is dragged over another control |
property OnEndDrag; |
|
Event handler for the end of a dragging process |
property OnEnter; |
|
OnEnter - event handler for when the mouse enters the control, and the control receives focus |
property OnExit; |
|
OnExit - event handler for when the mouse leaves the control and it loses focus |
property OnMouseDown; |
|
Event handler for when a mouse button is pressed down |
property OnMouseMove; |
|
Event handler for mouse movement within the current control |
property OnMouseUp; |
|
Event handler for when the mouse button is released, ie "up" |
property OnMouseEnter; |
|
Event handler for when the mouse enters the area of the current control |
property OnMouseLeave; |
|
Event handler for when the mouse leaves the area of the current control |
property OnResize; |
|
Event Handler for resize of control |
property OnChangeBounds; |
|
Event handler for a change in bounds of the control |
property OnStartDrag; |
|
Event handler for start of dragging process |
end; |
|
TToolbar manages tool buttons and other controls, arranging them in rows and automatically adjusting their sizes and positions. |
|
| | ||
TToolWindow |
||
? | ||
TObject |
TToolbar is a container for tool buttons (TToolButton). it provides an easy way to arrange and manage visual controls.
Typically, the tool buttons correspond to items in an application's menu and gives the user more direct access to the application's commands.
|
TToolButton is a button control in a TToolBar object. |
|
|
How to use StdCtrls, ComCtrls or ExtCtrls |
{ To use this example, create a new application and add the example code to the unit. Remember to add the ComCtls unit in the uses clause. } procedure AddButtons(ToolBar: TToolBar; const ButtonCaptions: array of String); var i: integer; begin for i := 0 to High(ButtonCaptions) do begin with TToolButton.Create(ToolBar) do begin Parent := ToolBar; Caption := ButtonCaptions[i]; if (ButtonCaptions[i] = '|') then Style := tbsSeparator else Style := tbsButton; AutoSize := True; end; end; end; procedure TForm1.FormCreate(Sender: TObject); var ToolBar: TToolBar; begin ToolBar := TToolBar.Create(Self); ToolBar.Parent := Self; ShowMessage(IntToStr(ToolBar.ButtonCount)); AddButtons(ToolBar, ['New', 'Save', '|', 'Cut', 'Copy', 'Paste']); ToolBar.ShowCaptions := True; ToolBar.Height := 40; ToolBar.ButtonWidth := 75; ShowMessage(IntToStr(ToolBar.ButtonCount)); end;