Sign in Join
FPDoc Onlineexperiment

TCustomCoolBar class

In unit ComCtrls

Defines a Rebar-like control with resizable bands.

Declaration

pascal
TCustomCoolBar = class(TToolWindow)

Inheritance

  1. TCustomCoolBar
  2. TToolWindow
  3. TCustomControl
  4. TWinControl
  5. TControl
  6. TLCLComponent
  7. TComponent
  8. TPersistent
  9. TObject

Descends from it: TCoolBar

Description

TCustomCoolBar is a TToolWindow descendant which defines a control like the Windows Rebar control. It provides a collection of windowed controls which are displayed in movable, resizable bands.

Each band (or TCoolBand) on the control can have a configurable sizing grip (or grabber), a bitmap, a text label, and a single windowed control. The CoolBar handles the size and position for the control when its band is moved. Each band can have a fixed size, or can automatically re-size to the contained control. Bands can be displayed one band per line, or re-sized and positioned to fill the available width or height for the CoolBar control.

A common use case is hosting multiple toolbars in an application. Separate TToolbar instance are created and configured with event handlers or actions as needed. Each toolbar is assigned as the control for a band. A perfect example is the Lazarus IDE, which uses TCoolbar to host the file, view and run toolbars in its interface.

Do not create instances of TCustomCoolBar; use the TCoolBar descendant which sets the visibility for the properties in the control.

See also

Properties

AlignpublicContains the edge in the Parent where the control is aligned.
BandBorderStylepublicBorder style used around bands on the control.
BandMaximizepublicIndicates the action used to maximize the width for a band on the control.
BandspublicCollection with the bands defined for the control.
BitmappublicOptional image displayed as the background for the cool bar control.
FixedSizepublicIndicates if bands on the control have a fixed size.
FixedOrderpublicIndicates if the order of the bands on the control is fixed or locked.
GrabStylepublicDrawing style used for a grabber or gripper displayed on the control.
GrabWidthpublicWidth for the grabber on the control.
HorizontalSpacingpublicHorizontal space reserved between visual elements on the control.
ImagespublicContains images displayed on the bands for the control.
ImagesWidthpublicWidth for the Images used in the control.
ShowTextpublicIndicates if text captions are displayed for the bands on the control.
ThemedpublicEnables or disables themed rendering for the control.
VerticalpublicIndicates if the control is displayed vertically instead of horizontally.
VerticalSpacingpublicVertical space reserved between visual elements in the control.

Methods

AlignControlsprotectedAligns the bands (and their controls) using the orientation, layout order, and anchors for the control.
BitmapOrImageListChangeprotectedImplements the OnChange handler used for Bitmap and Images.
CalculatePreferredSizeprotectedCalculates the preferred width and height for the control.
CalculateAndAlignprotectedCalculates the size and position for visible bands using the orientation, layout, and order for the control.
CalculateRealIndexprotectedGets the real position for the band at the specified visible position.
ChangeCursorprotectedChanges the cursor shape when a band, a grabber, or the control background is active.
CMBiDiModeChangedprotectedHandles the CM_BIDIMODECHANGED message for the control.
CreateWndprotectedCreates the window handle for the control, and sets the cursor shape for the control background.
DoFontChangedprotectedCalculates the text height and width in each of the bands when the font has been changed.
DrawTiledBitmapprotectedTile draws the specified bitmap on the control Canvas to fill the area in ARect.
FontChangedprotectedRe-implements the OnChange event handler for the Font in the control.
IsFirstAtRowprotectedChecks whether the band at the specified position is the first one on a row.
IsRowEndprotectedIndicates whether the band at the specified position is the last one on a row.
MouseDownprotectedHandles mouse down messages for the control.
MouseMoveprotectedHandles mouse move messages for the control.
MouseUpprotectedHandles mouse up messages for the control.
NotificationprotectedHandles the notification when a component is added to or removed from the control.
PaintprotectedDraws the visible bands for the control on its Canvas.
SetAlignprotectedSets the value for the Align property.
SetAutoSizeprotectedSets the value for the AutoSize property.
SetCursorprotectedSets the value for the Cursor property.
WMSizeprotectedHandles the LM_SIZE window message for the control.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
AutosizeBandspublicIndicates if a band is automatically resized to its Control.
EndUpdatepublicEnds an update process for the control.
InvalidatepublicCauses the control to be redrawn.
InsertControlpublicInserts a band for the specified control at the ordinal position in Index.
MouseToBandPospublicGets the position for the band under the mouse pointer.
RemoveControlpublicRemoves the band with the specified control.

Events

OnChangepublicEvent handler signalled when Bands are re-sized or re-ordered using the mouse.

Fields

FBorderEdgesprotectedMembers used for the realized EdgeBorders for the control.
FBorderLeftprotectedMember used for the realized left border on the control.
FBorderTopprotectedMember used for the realized top border on the control.
FBorderRightprotectedMember used for the realized right border on the control.
FBorderBottomprotectedMember used for the realized bottom border on the control.
FBorderWidthprotectedMember used for the total width of realized borders on the control.
FCursorBkgndprotectedMember with the cursor shape when the mouse is over the cool bar background.
FDragBandprotectedMember with the band being dragged in the control.
FDraggedBandIndexprotected-1 indicates the space below the last row; other negative values are an invalid area.
FDragInitPosprotectedInitial mouse X - position (for resizing Bands).
FLockCursorprotectedMember which indicates if the cursor shape can be changed for the control.
FRightToLeftprotectedMember which indicates is bands are aligned in reverse (right-to-left) order.
FTextHeightprotectedMember with the calculated text height used on the control.
FVisiBandsprotectedMember with the visible bands for the control.

Types and constants

cDefGrabStyleprotectedDefault value for the GrabStyle property.
cDefGrabWidthprotectedDefault value for the GrabWidth property.
cDefHorSpacingprotectedDefault value for the HorizontalSpacing property.
cDefVertSpacingprotectedDefault value for the VerticalSpacing property.
cNewRowBelowprotectedFree space below the last row.
cNewRowAboveprotectedFree space above the first row.

Inherited

From TToolWindow (5)

AdjustClientRect BeginUpdate EdgeBorders EdgeInner EdgeOuter

From TCustomControl (8)

BorderStyle Canvas DestroyWnd OnPaint PaintWindow SetColor WMPaint WSRegisterClass

From TWinControl (228)

AddControl AllAutoSized AutoAdjustLayout AutoSizeDelayed AutoSizeDelayedHandle AutoSizeDelayedReport AutoSizePhases BeginUpdateBounds BorderWidth BoundsLockCount BroadCast Brush BrushCreated CachedClientHeight CachedClientWidth CanFocus CanSetFocus CanTab ChangeScale ChildClassAllowed ChildHandlesCreated ChildKey ChildSizing ClientRectNeedsInterfaceUpdate CMBorderChanged CMDoubleBufferedChanged CMEnabledChanged CMEnter CMExit CMParentDoubleBufferedChanged CMShowHintChanged CMShowingChanged CMVisibleChanged CNChar CNKeyDown CNKeyUp CNSysKeyDown CNSysKeyUp ContainsControl ControlAtPos ControlCount ControlKeyDown ControlKeyUp Controls ControlsAligned CreateBrush CreateDockManager CreateHandle CreateParams CreateParented CreateParentedControl CreateSubClass CustomAlignInsertBefore CustomAlignPosition DefaultHandler DefWndProc DesignerDeleting DestroyHandle DialogChar DisableAlign DoAddDockClient DoAdjustClientRectChange DoAlignChildControls DoAllAutoSize DoAutoSize DoChildSizingChange DockClientCount DockClients DockDrop DockManager DockOver DockSite DoConstraintsChange DoDockClientMsg DoDockOver DoDragMsg DoEnter DoExit DoFlipChildren DoFloatMsg DoGetDockCaption DoKeyDownBeforeInterface DoKeyPress DoKeyUpBeforeInterface DoRemainingKeyDown DoRemainingKeyUp DoRemoveDockClient DoSendBoundsToInterface DoSendShowHideToInterface DoSetBounds DoubleBuffered DoUnDock DoUndockClientMsg DoUTF8KeyPress EnableAlign EndUpdateBounds EraseBackground FinalizeWnd FindChildControl FindNextControl FixDesignFontsPPIWithChildren FixupTabList FlipChildren Focused FormEndUpdated GetAdjustedLogicalClientRect GetBorderStyle GetChildren GetChildrenRect GetClientOrigin GetClientRect GetControlIndex GetControlOrigin GetDeviceContext GetDockCaption GetEnumeratorControls GetEnumeratorControlsReverse GetMouseCapture GetParentHandle GetPreferredSizeClientFrame GetSiteInfo GetTabOrderList GetTextLen GetTopParentHandle Handle HandleAllocated HandleNeeded InitializeWnd IntfGetDropFilesTarget IntfUTF8KeyPress InvalidateBoundsRealized InvalidateClientRectCache InvalidatePreferredChildSizes IsClientHeightStored IsClientWidthStored IsControlMouseMsg IsFlipped IsResizing IsSpecialSubControl KeyDown KeyDownAfterInterface KeyDownBeforeInterface KeyPress KeyUp KeyUpAfterInterface KeyUpBeforeInterface Loaded LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnDockDrop OnDockOver OnEnter OnExit OnGetDockCaption OnGetSiteInfo OnKeyDown OnKeyPress OnKeyUp OnUnDock OnUTF8KeyPress PaintControls PaintHandler PaintTo ParentDoubleBuffered ParentFormHandleInitialized ParentHandlesAllocated ParentWindow PerformTab RealGetText ReAlign RealizeBounds RealizeBoundsRecursive RealSetText ReloadDockedControl RemoveFocus Repaint ScaleBy ScaleControls ScrollBy ScrollBy_WS SelectFirst SelectNext SendDialogChar SendMoveSizeMessages SetBorderStyle SetBounds SetChildZPosition SetControlIndex SetDockManager SetFocus SetShape SetTempCursor ShowControl Showing TabOrder TabStop UnlockRealizeBounds Update UpdateControlState UpdateDockCaption UpdateShowing UseDockManager UTF8KeyPress VisibleDockClientCount WindowHandle WMChar WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMKillFocus WMMove WMNotify WMSetFocus WMShowWindow WMSysChar WMSysKeyDown WMSysKeyUp WMWindowPosChanged WndProc WriteLayoutDebugReport WSSetText

From TControl (359)

AccessibleDescription AccessibleName AccessibleRole AccessibleValue Action ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel Anchors AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSize AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeforeDragStart BeginAutoDrag BeginAutoSizing BeginDrag BiDiMode BorderSpacing BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize Caption CaptureChanged CaptureMouseButtons ChangeBounds Changed CheckChildClassAllowed CheckNewParent CheckOnChangeBounds Click ClientHeight ClientOrigin ClientRect ClientToParent ClientToScreen ClientWidth CMChanged CMCursorChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentBiDiModeChanged CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CNPreferredSizeChanged Color ColorIsStored ConstrainedResize Constraints ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DblClick DefineProperties DesktopFont DisableAutoSizing DoAutoAdjustLayout DoBorderSpacingChange DoCallKeyEventHandler DoCallMouseWheelEventHandler DoCallNotifyHandler Dock Docked DockOrientation DockTrackNoTarget DoContextPopup DoDock DoEndDock DoEndDrag DoFixDesignFontPPI DoMouseDown DoMouseUp DoMouseWheel DoMouseWheelDown DoMouseWheelHorz DoMouseWheelLeft DoMouseWheelRight DoMouseWheelUp DoOnChangeBounds DoOnParentHandleDestruction DoOnResize DoOnShowHint DoScaleFontPPI DoStartDock DoStartDrag DragCanceled DragCursor DragDrop Dragging DragKind DragMode DragOver EditingDone EnableAutoSizing Enabled EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass Font ForeignAnchorSideChanged FormIsUpdating GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetClientScrollOffset GetColorResolvingParent GetControlClassDefaultSize GetCursor GetDefaultColor GetDefaultDockCaption GetDefaultHeight GetDefaultWidth GetDockEdge GetDragImages GetEnabled GetFloating GetFloatingDockSiteClass GetLogicalClientRect GetMousePosFromMessage GetPalette GetParentBackground GetParentComponent GetPopupMenu GetPreferredSize GetRGBColorResolvingParent GetScrolledClientRect GetSelectedChildAccessibleObject GetSidePosition GetTextBuf GetTopParent HandleObjectShouldBeVisible HasHelp HasParent Height HeightIsAnchored HelpContext HelpKeyword HelpType Hide Hint HostDockSite InitiateAction InvalidateControl InvalidatePreferredSize IsAParentAligning IsBorderSpacingInnerBorderStored IsCaptionStored IsControl IsControlVisible IsEnabled IsParentColor IsParentFont IsParentOf IsProcessingPaintMsg IsRightToLeft IsVisible Left LMCaptureChanged LoadedAll LRDockWidth ManualDock ManualFloat MouseCapture MouseEnter MouseInClient MouseLeave OnChangeBounds OnClick OnConstrainedResize OnContextPopup OnDblClick OnDragDrop OnDragOver OnEditingDone OnEndDock OnEndDrag OnMouseDown OnMouseEnter OnMouseLeave OnMouseMove OnMouseUp OnMouseWheel OnMouseWheelDown OnMouseWheelHorz OnMouseWheelLeft OnMouseWheelRight OnMouseWheelUp OnQuadClick OnResize OnShowHint OnStartDock OnStartDrag OnTripleClick Parent ParentBackground ParentBiDiMode ParentColor ParentDestroyingHandle ParentFont ParentFontChanged ParentShowHint ParentToClient Perform PopupMenu PositionDockRect QuadClick ReadBounds ReadState Refresh RemoveAllHandlersOfObject RemoveHandler RemoveHandlerOnBeforeDestruction RemoveHandlerOnChangeBounds RemoveHandlerOnEnabledChanged RemoveHandlerOnEnabledChanging RemoveHandlerOnKeyDown RemoveHandlerOnMouseWheel RemoveHandlerOnResize RemoveHandlerOnVisibleChanged RemoveHandlerOnVisibleChanging ReplaceDockedControl RequestAlign Resize Scale96ToFont Scale96ToForm Scale96ToScreen ScaleConstraints ScaleDesignToForm ScaleFontsPPI ScaleFontTo96 ScaleFontToScreen ScaleFormTo96 ScaleFormToDesign ScaleScreenTo96 ScaleScreenToFont ScreenToClient ScreenToControl SendToBack SessionProperties SetAction SetAnchors SetBiDiMode SetBoundsKeepBase SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParent SetParentBackground SetParentBiDiMode SetParentComponent SetTextBuf SetVisible SetZOrder ShouldAutoAdjust Show ShowHelp ShowHint TBDockHeight Text TextChanged Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar Visible VisibleChanged VisibleChanging Width WidthIsAnchored WindowProc WMCancelMode WMLButtonDBLCLK WMLButtonDown WMLButtonQuadCLK WMLButtonTripleCLK WMLButtonUp WMMButtonDBLCLK WMMButtonDown WMMButtonQuadCLK WMMButtonTripleCLK WMMButtonUp WMMouseHWheel WMMouseMove WMMouseWheel WMRButtonDBLCLK WMRButtonDown WMRButtonQuadCLK WMRButtonTripleCLK WMRButtonUp WMXButtonDBLCLK WMXButtonDown WMXButtonQuadCLK WMXButtonTripleCLK WMXButtonUp

From TLCLComponent (6)

DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance WidgetSetClass

From TComponent (64)

_AddRef _Release CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetTypeInfo GetTypeInfoCount iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (4)

Assign FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (35)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.