Sign in Join
FPDoc Onlineexperiment

TColorListBox class

In unit ColorBox

Implements a list box control used to display and select color names and values.

Declaration

pascal
TColorListBox = class(TCustomColorListBox)

Inheritance

  1. TColorListBox
  2. TCustomColorListBox
  3. TCustomListBox
  4. TWinControl
  5. TControl
  6. TLCLComponent
  7. TComponent

Description

TColorListBox is a TCustomColorListBox descendant which implements a list box control used to display and select color names and values. Each item in the control has a small rectangle where the color is displayed (swatch) and the color name.

The Style property is used to configure the list of available colors and their display names. Style may also trigger use of the OnGetColors event handler to get the items displayed in the list box control.

The ColorRectWidth and ColorRectOffset properties can be used to control the size and spacing for the color swatch displayed for the list items.

Colors allows indexed access to the TColor values in the list of items. When included in the Style property, colors like clDefault and/or clNone may be included in the list of Colors. The DefaultColorColor and NoneColorColor properties can be used to specify the TColor values used for those color constants.

ColorNames allows indexed access to the names for the values in Colors.

Use TCustomColorBox / TColorBox to display color names and values in a combo-box control.

See also

Properties

ColorRectWidthpublishedWidth for the color sample (swatch) displayed for colors in the item list.
ColorRectOffsetpublishedNumber of pixels between the color sample and the color name.
DefaultColorColorpublishedTColor used for the clDefault color constant.
NoneColorColorpublishedTColor used for the clNone color constant.
SelectedpublishedThe TColor value for the selected item in the list box control.
StylepublishedSettings which determine the colors available in the control and their display style.
ColorDialogpublishedDialog displayed to select a custom color for the control.
AlignpublishedSpecifies the placement of the control on its Parent control.
AnchorspublishedThe set of anchor definitions for this control.
BidiModepublishedIndicates whether text controls use in bi-directional reading.
BorderSpacingpublishedDetermines the inner and outer border spacing for this control.
BorderStylepublishedLine style used for the border on the control.
ClickOnSelChangepublishedAllows selection changes to generate a Click event.
ColorpublishedThe background color for the control.
ConstraintspublishedContains the minimum and maximum Width and Height for the control.
DragCursorpublishedThe cursor shape shown during a drag operation.
DragKindpublishedIndicates the action performed for a drag operation: drag-and-drop or drag-and-dock.
DragModepublishedDetermines how a drag operation is started for the control.
ExtendedSelectpublishedTrue when a contiguous range of items can be selected using Shift+Click. The default value is True.
EnabledpublishedDetermines whether the control responds to mouse or keyboard input.
FontpublishedThe font to be used for text display in this control.
IntegralHeightpublishedNot implemented: shrink the Height of the widget, so that it only shows fully visible rows.
ItemHeightpublishedThe default height for an item displayed in the list.
ParentBidiModepublishedIndicates whether the BiDiMode settings in the Parent control are used.
ParentColorpublishedUse the Color from the Parent control, when enabled.
ParentShowHintpublishedIf True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
ParentFontpublishedIndicates if the Font from the Parent control is used in the control.
PopupMenupublishedA context-sensitive menu that pops up when the right mouse button is clicked over this control.
ShowHintpublishedEnables Hint display for the control.
TabOrderpublishedIndicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
TabStoppublishedEnables keyboard navigation using the Tab or Shift+Tab keys.
TopIndexpublishedIndex of the first visible (or top-most) item.
VisiblepublishedAllows the control, and all of its children, to be displayed or hidden.

Events

OnGetColorspublishedOnGetColors - event handler for the instruction to get colors.
OnChangeBoundspublishedEvent handler signalled when the Bounds for the control have been changed.
OnClickpublishedNotification handler for mouse clicks.
OnContextPopuppublishedInvoked when a context-sensitive pop-up menu is requested.
OnDblClickpublishedEvent handler signalled when a mouse double click occurs in the control.
OnDragDroppublishedEvent handler signalled when an object is dropped onto the control.
OnDragOverpublishedEvent handler signalled when a control is dragged over the control instance.
OnEnterpublishedEvent handler signalled when the control receives focus.
OnEndDragpublishedEvent handler signalled for the end of a drag-drop operation.
OnExitpublishedEvent handler signalled when the control loses focus.
OnKeyPresspublishedEvent handler signalled for character data entered by the user.
OnKeyDownpublishedEvent handler signalled for key down keyboard events.
OnKeyUppublishedEvent handler signalled when a key up event has occurred for the control.
OnMouseDownpublishedEvent handler signalled when a mouse down event is handled for the control.
OnMouseEnterpublishedEvent handler signalled when the mouse pointer has entered the control.
OnMouseLeavepublishedEvent handler signalled when the mouse pointer has left the control.
OnMouseMovepublishedEvent handler signalled when the mouse pointer is moved in the control.
OnMouseUppublishedEvent handler signalled when a mouse up event is handled for the control.
OnMouseWheelpublishedEvent handler for mouse wheel turned.
OnMouseWheelDownpublishedEvent handler signalled for a downward movement of the mouse wheel.
OnMouseWheelUppublishedEvent handler signalled for an upward movement of the mouse wheel.
OnMouseWheelHorzpublishedEvent handler signalled for a horizontal movement of the mouse wheel.
OnMouseWheelLeftpublishedEvent handler signalled for a leftward movement of the mouse wheel.
OnMouseWheelRightpublishedEvent handler signalled for a rightward movement of the mouse wheel.
OnResizepublishedNotification handler for a resize of the control.
OnSelectionChangepublishedHandler invoked when an item is selected in the control.
OnShowHintpublishedEvent handler signalled when a hint window is displayed for the control.
OnStartDragpublishedEvent handler signalled for the start of a dragging operation.
OnUTF8KeyPresspublishedHandler for a character entered by the user.

Inherited

From TCustomColorListBox (13)

ColorNames ColorRectWidthStored Colors Create DoAutoAdjustLayout DoGetColors DoSelectionChange DrawItem InitializeWnd Loaded Notification PickCustomColor SetColorList

From TCustomListBox (61)

AddItem AssignCacheToItemData AssignItemDataToCache BeforeDragStart BeginAutoDrag CalculateStandardItemHeight Canvas CheckIndex Clear ClearSelection Click Columns Count CreateParams DeleteSelected Destroy DestroyWnd FinalizeWnd GetCachedData GetCachedDataSize GetControlClassDefaultSize GetIndexAtXY GetIndexAtY GetItemHeight GetItemIndex GetSelCount GetSelected GetSelectedText ItemAtPos ItemFullyVisible ItemIndex ItemRect Items ItemVisible LockSelectionChange MakeCurrentVisible MeasureItem MultiSelect OnData OnDataFind OnDataObject OnDrawItem OnMeasureItem Options ScrollWidth SelCount SelectAll SelectRange SendItemIndex SetExtendedSelect SetItemHeight SetItemIndex SetItems SetMultiSelect SetSelected SetSorted SetStyle Sorted UnlockSelectionChange WMGetDlgCode WSRegisterClass

From TWinControl (229)

AddControl AdjustClientRect AlignControls AllAutoSized AutoAdjustLayout AutoSizeDelayed AutoSizeDelayedHandle AutoSizeDelayedReport AutoSizePhases BeginUpdateBounds BorderWidth BoundsLockCount BroadCast Brush BrushCreated CachedClientHeight CachedClientWidth CalculatePreferredSize CanFocus CanSetFocus CanTab ChangeScale ChildClassAllowed ChildHandlesCreated ChildKey ChildSizing ClientRectNeedsInterfaceUpdate CMBiDiModeChanged CMBorderChanged CMDoubleBufferedChanged CMEnabledChanged CMEnter CMExit CMParentDoubleBufferedChanged CMShowHintChanged CMShowingChanged CMVisibleChanged CNChar CNKeyDown CNKeyUp CNSysKeyDown CNSysKeyUp ContainsControl ControlAtPos ControlCount ControlKeyDown ControlKeyUp Controls ControlsAligned CreateBrush CreateDockManager CreateHandle CreateParented CreateParentedControl CreateSubClass CreateWnd 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 FindChildControl FindNextControl FixDesignFontsPPIWithChildren FixupTabList FlipChildren Focused FontChanged FormEndUpdated GetAdjustedLogicalClientRect GetBorderStyle GetChildren GetChildrenRect GetClientOrigin GetClientRect GetControlIndex GetControlOrigin GetDeviceContext GetDockCaption GetEnumeratorControls GetEnumeratorControlsReverse GetMouseCapture GetParentHandle GetPreferredSizeClientFrame GetSiteInfo GetTabOrderList GetTextLen GetTopParentHandle Handle HandleAllocated HandleNeeded InsertControl IntfGetDropFilesTarget IntfUTF8KeyPress Invalidate InvalidateBoundsRealized InvalidateClientRectCache InvalidatePreferredChildSizes IsClientHeightStored IsClientWidthStored IsControlMouseMsg IsFlipped IsResizing IsSpecialSubControl KeyDown KeyDownAfterInterface KeyDownBeforeInterface KeyPress KeyUp KeyUpAfterInterface KeyUpBeforeInterface LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnDockDrop OnDockOver OnGetDockCaption OnGetSiteInfo OnUnDock PaintControls PaintHandler PaintTo PaintWindow ParentDoubleBuffered ParentFormHandleInitialized ParentHandlesAllocated ParentWindow PerformTab RealGetText ReAlign RealizeBounds RealizeBoundsRecursive RealSetText ReloadDockedControl RemoveControl RemoveFocus Repaint ScaleBy ScaleControls ScrollBy ScrollBy_WS SelectFirst SelectNext SendDialogChar SendMoveSizeMessages SetBorderStyle SetBounds SetChildZPosition SetColor SetControlIndex SetDockManager SetFocus SetShape SetTempCursor ShowControl Showing UnlockRealizeBounds Update UpdateControlState UpdateDockCaption UpdateShowing UseDockManager UTF8KeyPress VisibleDockClientCount WindowHandle WMChar WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMKillFocus WMMove WMNotify WMPaint WMSetFocus WMShowWindow WMSize WMSysChar WMSysKeyDown WMSysKeyUp WMWindowPosChanged WndProc WriteLayoutDebugReport WSSetText

From TControl (322)

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 AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSize AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeginAutoSizing BeginDrag BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize Caption CaptureChanged CaptureMouseButtons ChangeBounds Changed CheckChildClassAllowed CheckNewParent CheckOnChangeBounds ClientHeight ClientOrigin ClientRect ClientToParent ClientToScreen ClientWidth CMChanged CMCursorChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentBiDiModeChanged CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CNPreferredSizeChanged ColorIsStored ConstrainedResize ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DblClick DefineProperties DesktopFont DisableAutoSizing 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 DragDrop Dragging DragOver EditingDone EnableAutoSizing EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass ForeignAnchorSideChanged FormIsUpdating GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetClientScrollOffset GetColorResolvingParent 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 MouseDown MouseEnter MouseInClient MouseLeave MouseMove MouseUp OnConstrainedResize OnEditingDone OnEndDock OnQuadClick OnStartDock OnTripleClick Parent ParentBackground ParentDestroyingHandle ParentFontChanged ParentToClient Perform 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 SetAlign SetAnchors SetAutoSize SetBiDiMode SetBoundsKeepBase SetCursor SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParent SetParentBackground SetParentBiDiMode SetParentComponent SetTextBuf SetVisible SetZOrder ShouldAutoAdjust Show ShowHelp TBDockHeight Text TextChanged Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar 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

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.