SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Component Class Referenceabstract

Base class for all UI components providing window creation, event handling, and listener management. More...

#include <Component.h>

Inheritance diagram for Component:
Accordion Button ButtonGrid ButtonMenu Calendar CardPanel Chart ChartLegend CheckBox CheckComboBox CheckList ComboBox DateTimePicker Dialog Frame Grid GridView IconMenu Image Label ListBox MaskedField PanelBase PickList ProgressBar Radio Rating Slider Switch TabPane TextArea TextField ToggleButton ToolTip Toolbar TreeView

Public Member Functions

 Component ()
 Constructs a new Component instance.
virtual ~Component ()
 Virtual destructor.
long getId ()
 Gets the unique ID assigned to this component.
void setParent (Component *parent)
ComponentgetParent ()
wstring getComponentType ()
 Gets the component type string.
BOOL isWindowCreated ()
 Returns whether the native window has been created.
WinHandle getWindowHandle ()
 Returns the native WinHandle for this component.
int createComponent (WinHandle hParent, Bounds rect, long nCmd=-1, BOOL isVisible=TRUE)
 Creates the component's native window as a child of hParent.
void setFont (long fontSize, BOOL isBold=FALSE, BOOL isItalic=FALSE, BOOL isUnderlined=FALSE, const wstring &fontName=L"Arial")
 Sets the font for the component.
void showBorder (BOOL bShow=TRUE)
void setEnabled (BOOL bEnable=TRUE)
 Enables or disables the component.
void setVisible (BOOL bShow=TRUE)
 Shows or hides the component.
void GetClientRect (Bounds &rect)
void GetWindowRect (Bounds &rect)
void moveWindow (long x, long y, long width, long height, BOOL bRedraw=TRUE)
 Moves and resizes the component window.
void reconfigureScrollBar ()
 Forces the component to recalculate the scrollbar info.
void setMouseWheelDelta (int delta)
 Sets the accumulated mouse wheel delta.
int getMouseWheelDelta ()
 Gets the current mouse wheel delta.
virtual int getMinimumHeight ()
 Returns the minimum height the component can have.
virtual int getPreferredHeight ()
 Returns the preferred height of the component.
void repaint (WinHandle hWnd=NULL)
 Requests the component to repaint itself.
void clearQueuedPaintRequest ()
 clears the queued paint request. This function should only be called internally from the library.
virtual void onPaint (Graphics *g)
 Called to paint the component's client area.
virtual void onWindowResized ()
 Called when the component's window is resized.
virtual void onWindowMoved ()
 Called when the component's window is moved.
virtual void onAction (WinHandle hTarget, long actionId, const ProcParams &procParams)
 Called when an action occurs on the component.
virtual void onSelectionChanged (WinHandle hTarget, int itemIndex, const wstring &itemText, BOOL itemChecked, const ProcParams &procParams)
 Called when the selection changes.
virtual void onDataChanged (WinHandle hTarget, const wstring &newValue, const ProcParams &procParams)
 Called when data changes in the component.
virtual BOOL onHorzScroll (WinHandle hTarget, const ProcParams &procParams)
 Called on horizontal scroll events.
virtual BOOL onDrawMeasureItem (LPMEASUREITEMSTRUCT dis, const ProcParams &procParams)
 Called when measuring an item for owner-draw controls.
virtual BOOL onDrawItem (LPDRAWITEMSTRUCT dis, const ProcParams &procParams)
 Called when drawing an item for owner-draw controls.
virtual void onMousePressed (WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed)
 Called when the mouse is pressed within the component.
virtual void onMouseReleased (WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
 Called when the mouse button is released within the component.
virtual void onMouseRightClicked (WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
 Called when the right mouse button is clicked within the component.
virtual void onMouseMoved (WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
 Called when the mouse is moved within the component.
virtual BOOL onMouseWheel (WinHandle hWnd, int x, int y, int delta)
 Called when the mouse wheel is used over the component.
virtual void onArrowLeft (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onArrowRight (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onArrowUp (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onArrowDown (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onPageUp (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onPageDown (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyHome (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyEnd (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyInsert (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyDelete (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyBackSpace (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyTyped (wchar_t ch, BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyTab (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyEnter (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF1 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF2 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF3 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF4 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF5 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF6 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF7 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF8 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF9 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF10 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF11 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onKeyF12 (BOOL shiftPressed, BOOL ctrlPressed)
virtual void onFocusGained ()
 Called when the component gains keyboard focus.
virtual void onFocusLost ()
 Called when the component loses keyboard focus.
virtual void onTimer (unsigned int timerId)
 Called on timer events.
virtual BOOL getScrollingInfo (__int64 &scrollMin, __int64 &scrollMax, __int64 &pageSize)
 Provides scrolling information if supported.
virtual void setScrollbarTopOffset (__int64 firstVisibleRow)
 Sets the scrollbar's top offset.
void updateScrollbarTopOffset (__int64 firstVisibleRow)
 Updates the scrollbar's top offset based on the current first visible row.

Protected Member Functions

virtual BOOL getCreateWindowOptions (wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)=0
 Abstract method to get window creation options.
virtual void windowCreated ()=0
 Abstract method called after the window has been created.
long getActionId ()
 Returns the component's action command ID.
void doNotSubclass ()
 Marks this component's native window to avoid subclassing.
void startTimer (unsigned int timerId, unsigned int milliseconds)
 Starts a timer with the given ID and interval.
void stopTimer (unsigned int timerId)
 Stops the timer identified by timerId.
void protectedAddDataChangedListener (DataChangeListener *l)
 Adds a data change listener.
void protectedAddSelectionChangedListener (SelectionChangeListener *l)
 Adds a selection change listener.
void protectedAddActionListener (ActionListener *l)
 Adds an action listener.
void protectedAddItemDoubleClickedListener (RowDoubleClickListener *l)
 Adds a row double-click listener.
void protectedFireDataChangedEvent (const wstring &oldValue, const wstring &newValue)
 Fires a data changed event to registered listeners.
void protectedFireSelectionChangedEvent (long selectionIndex=-1, const wstring &selectionValue=L"", BOOL checked=FALSE)
 Fires a selection changed event to registered listeners.
void protectedFireActionEvent (long actionId=-1, const wstring &actionName=L"")
 Fires an action event to registered listeners.
void protectedFireItemDoubleClickedEvent (__int64 rowIndex)
 Fires a row double-click event to registered listeners.

Protected Attributes

WinHandle _hWnd
 Handle to the native window associated with this component.
wstring _componentType
 String representing the component type (e.g., "Button", "ComboBox").
BOOL _showBorder

Detailed Description

Base class for all UI components providing window creation, event handling, and listener management.

This abstract class provides common functionality for windowed components, including:

  • Unique ID generation for each component instance
  • Window creation and management
  • Font and appearance customization
  • Event handling through virtual overridable methods
  • Support for data change, selection change, action, and double-click listeners
  • Scrollbar support and timer management

Derived classes must implement getCreateWindowOptions() and windowCreated() to specify window creation details and initialization logic.

Constructor & Destructor Documentation

◆ Component()

Component::Component ( )

Constructs a new Component instance.

◆ ~Component()

virtual Component::~Component ( )
virtual

Virtual destructor.

Member Function Documentation

◆ clearQueuedPaintRequest()

void Component::clearQueuedPaintRequest ( )

clears the queued paint request. This function should only be called internally from the library.

◆ createComponent()

int Component::createComponent ( WinHandle hParent,
Bounds rect,
long nCmd = -1,
BOOL isVisible = TRUE )

Creates the component's native window as a child of hParent.

Parameters
hParentParent window handle.
rectInitial window rectangle.
nCmdOptional command ID associated with the component.
isVisibleTRUE to show the window immediately.
Returns
TRUE if creation succeeded.

◆ doNotSubclass()

void Component::doNotSubclass ( )
protected

Marks this component's native window to avoid subclassing.

◆ getActionId()

long Component::getActionId ( )
protected

Returns the component's action command ID.

Returns
Action ID associated with this component.

◆ GetClientRect()

void Component::GetClientRect ( Bounds & rect)

◆ getComponentType()

wstring Component::getComponentType ( )

Gets the component type string.

Returns
Component type name.

◆ getCreateWindowOptions()

virtual BOOL Component::getCreateWindowOptions ( wstring & title,
UINT & widownStyles,
wstring & wndClassName,
BOOL & isCustomWndProc )
protectedpure virtual

Abstract method to get window creation options.

Derived classes must override this to provide window title, styles, class name, and whether a custom window procedure is used.

Parameters
titleOutput window title.
widownStylesOutput window styles.
wndClassNameOutput window class name.
isCustomWndProcOutput TRUE if a custom window procedure is used.
Returns
TRUE if options were set successfully.

Implemented in Accordion, Button, ButtonGrid, ButtonMenu, Calendar, CardPanel, Chart, ChartLegend, CheckBox, CheckComboBox, CheckList, ComboBox, DateTimePicker, Dialog, Frame, Grid, GridView, IconMenu, Image, Label, ListBox, MaskedField, PanelBase, PickList, ProgressBar, Radio, Rating, Slider, Switch, TabPane, TextArea, TextField, ToggleButton, Toolbar, ToolTip, and TreeView.

◆ getId()

long Component::getId ( )

Gets the unique ID assigned to this component.

Returns
Unique component ID.

◆ getMinimumHeight()

virtual int Component::getMinimumHeight ( )
virtual

Returns the minimum height the component can have.

Returns
Minimum height in pixels.

◆ getMouseWheelDelta()

int Component::getMouseWheelDelta ( )

Gets the current mouse wheel delta.

Returns
Mouse wheel delta value.

◆ getParent()

Component * Component::getParent ( )

◆ getPreferredHeight()

virtual int Component::getPreferredHeight ( )
virtual

Returns the preferred height of the component.

Returns
Preferred height in pixels.

Reimplemented in CheckBox, CheckComboBox, ComboBox, DateTimePicker, MaskedField, ProgressBar, Rating, Slider, Switch, TextArea, TextField, and ToggleButton.

◆ getScrollingInfo()

virtual BOOL Component::getScrollingInfo ( __int64 & scrollMin,
__int64 & scrollMax,
__int64 & pageSize )
inlinevirtual

Provides scrolling information if supported.

Parameters
scrollMinOutput minimum scroll value.
scrollMaxOutput maximum scroll value.
pageSizeOutput page size.
Returns
TRUE if scrollbar is applicable and info is provided, FALSE otherwise.

Reimplemented in ButtonGrid, ButtonMenu, CheckList, FluidPanel, Grid, GridPanel, IconMenu, ListBox, Radio, and TreeView.

◆ getWindowHandle()

WinHandle Component::getWindowHandle ( )

Returns the native WinHandle for this component.

Returns
Handle to the native window.

◆ GetWindowRect()

void Component::GetWindowRect ( Bounds & rect)

◆ isWindowCreated()

BOOL Component::isWindowCreated ( )

Returns whether the native window has been created.

Returns
TRUE if the window is created, FALSE otherwise.

◆ moveWindow()

void Component::moveWindow ( long x,
long y,
long width,
long height,
BOOL bRedraw = TRUE )

Moves and resizes the component window.

Parameters
xNew X coordinate.
yNew Y coordinate.
widthNew width.
heightNew height.

◆ onAction()

virtual void Component::onAction ( WinHandle hTarget,
long actionId,
const ProcParams & procParams )
inlinevirtual

Called when an action occurs on the component.

Parameters
hTargetHandle to the target window.
actionIdAction identifier.
procParamsAdditional parameters.

Reimplemented in PanelBase, and Toolbar.

◆ onArrowDown()

virtual void Component::onArrowDown ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onArrowLeft()

virtual void Component::onArrowLeft ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onArrowRight()

virtual void Component::onArrowRight ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onArrowUp()

virtual void Component::onArrowUp ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onDataChanged()

virtual void Component::onDataChanged ( WinHandle hTarget,
const wstring & newValue,
const ProcParams & procParams )
inlinevirtual

Called when data changes in the component.

Parameters
hTargetHandle to the target window.
newValueThe new data value.
procParamsAdditional parameters.

Reimplemented in PanelBase, TextArea, and TextField.

◆ onDrawItem()

virtual BOOL Component::onDrawItem ( LPDRAWITEMSTRUCT dis,
const ProcParams & procParams )
inlinevirtual

Called when drawing an item for owner-draw controls.

Parameters
disPointer to DRAWITEMSTRUCT.
procParamsAdditional parameters.
Returns
TRUE if handled, FALSE otherwise.

Reimplemented in PanelBase.

◆ onDrawMeasureItem()

virtual BOOL Component::onDrawMeasureItem ( LPMEASUREITEMSTRUCT dis,
const ProcParams & procParams )
inlinevirtual

Called when measuring an item for owner-draw controls.

Parameters
disPointer to MEASUREITEMSTRUCT.
procParamsAdditional parameters.
Returns
TRUE if handled, FALSE otherwise.

Reimplemented in PanelBase.

◆ onFocusGained()

virtual void Component::onFocusGained ( )
inlinevirtual

Called when the component gains keyboard focus.

Reimplemented in Calendar, CheckList, Grid, and ListBox.

◆ onFocusLost()

virtual void Component::onFocusLost ( )
inlinevirtual

Called when the component loses keyboard focus.

Reimplemented in Calendar, CheckList, Grid, and ListBox.

◆ onHorzScroll()

virtual BOOL Component::onHorzScroll ( WinHandle hTarget,
const ProcParams & procParams )
inlinevirtual

Called on horizontal scroll events.

Parameters
hTargetHandle to the target window.
procParamsAdditional parameters.
Returns
TRUE if the scroll event was handled, FALSE otherwise.

Reimplemented in PanelBase.

◆ onKeyBackSpace()

virtual void Component::onKeyBackSpace ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Reimplemented in Calendar.

◆ onKeyDelete()

virtual void Component::onKeyDelete ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyEnd()

virtual void Component::onKeyEnd ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyEnter()

virtual void Component::onKeyEnter ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF1()

virtual void Component::onKeyF1 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF10()

virtual void Component::onKeyF10 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF11()

virtual void Component::onKeyF11 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF12()

virtual void Component::onKeyF12 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF2()

virtual void Component::onKeyF2 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF3()

virtual void Component::onKeyF3 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF4()

virtual void Component::onKeyF4 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF5()

virtual void Component::onKeyF5 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF6()

virtual void Component::onKeyF6 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF7()

virtual void Component::onKeyF7 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF8()

virtual void Component::onKeyF8 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyF9()

virtual void Component::onKeyF9 ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyHome()

virtual void Component::onKeyHome ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyInsert()

virtual void Component::onKeyInsert ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onKeyTab()

virtual void Component::onKeyTab ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Reimplemented in Grid.

◆ onKeyTyped()

virtual void Component::onKeyTyped ( wchar_t ch,
BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Reimplemented in Calendar.

◆ onMouseMoved()

virtual void Component::onMouseMoved ( WinHandle hWnd,
int x,
int y,
BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Called when the mouse is moved within the component.

Reimplemented in Button, ButtonMenu, Rating, and Slider.

◆ onMousePressed()

virtual void Component::onMousePressed ( WinHandle hWnd,
int x,
int y,
int clickCount,
BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Called when the mouse is pressed within the component.

Reimplemented in Button, ButtonGrid, ButtonMenu, Calendar, CheckBox, CheckComboBox, CheckList, DateTimePicker, Grid, IconMenu, ListBox, Radio, Rating, Slider, Switch, TabPane, ToggleButton, Toolbar, ToolTip, and TreeView.

◆ onMouseReleased()

virtual void Component::onMouseReleased ( WinHandle hWnd,
int x,
int y,
BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Called when the mouse button is released within the component.

Reimplemented in Button, ButtonGrid, ButtonMenu, IconMenu, Slider, and Toolbar.

◆ onMouseRightClicked()

virtual void Component::onMouseRightClicked ( WinHandle hWnd,
int x,
int y,
BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

Called when the right mouse button is clicked within the component.

Reimplemented in ButtonGrid, ButtonMenu, IconMenu, and TreeView.

◆ onMouseWheel()

virtual BOOL Component::onMouseWheel ( WinHandle hWnd,
int x,
int y,
int delta )
inlinevirtual

Called when the mouse wheel is used over the component.

Parameters
hWndHandle to the window receiving the event.
xX coordinate of the mouse.
yY coordinate of the mouse.
deltaMouse wheel delta.
Returns
TRUE if the event was handled, FALSE otherwise.

Reimplemented in ButtonGrid, ButtonMenu, Calendar, CheckList, FluidPanel, Grid, GridPanel, IconMenu, ListBox, Radio, Toolbar, and TreeView.

◆ onPageDown()

virtual void Component::onPageDown ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onPageUp()

virtual void Component::onPageUp ( BOOL shiftPressed,
BOOL ctrlPressed )
inlinevirtual

◆ onPaint()

virtual void Component::onPaint ( Graphics * g)
inlinevirtual

◆ onSelectionChanged()

virtual void Component::onSelectionChanged ( WinHandle hTarget,
int itemIndex,
const wstring & itemText,
BOOL itemChecked,
const ProcParams & procParams )
inlinevirtual

Called when the selection changes.

Parameters
hTargetHandle to the target window.
itemIndexIndex of the selected item.
itemTextText of the selected item.
itemCheckedChecked state (for multi-select components).
procParamsAdditional parameters.

Reimplemented in ComboBox, PanelBase, and Slider.

◆ onTimer()

virtual void Component::onTimer ( unsigned int timerId)
inlinevirtual

Called on timer events.

Parameters
timerIdThe timer ID.

Reimplemented in Frame, and ToolTip.

◆ onWindowMoved()

virtual void Component::onWindowMoved ( )
inlinevirtual

Called when the component's window is moved.

Reimplemented in CardPanel, CheckComboBox, DateTimePicker, Dialog, Frame, and PanelBase.

◆ onWindowResized()

virtual void Component::onWindowResized ( )
inlinevirtual

◆ protectedAddActionListener()

void Component::protectedAddActionListener ( ActionListener * l)
protected

Adds an action listener.

Parameters
lPointer to an ActionListener instance.

◆ protectedAddDataChangedListener()

void Component::protectedAddDataChangedListener ( DataChangeListener * l)
protected

Adds a data change listener.

Parameters
lPointer to a DataChangeListener instance.

◆ protectedAddItemDoubleClickedListener()

void Component::protectedAddItemDoubleClickedListener ( RowDoubleClickListener * l)
protected

Adds a row double-click listener.

Parameters
lPointer to a RowDoubleClickListener instance.

◆ protectedAddSelectionChangedListener()

void Component::protectedAddSelectionChangedListener ( SelectionChangeListener * l)
protected

Adds a selection change listener.

Parameters
lPointer to a SelectionChangeListener instance.

◆ protectedFireActionEvent()

void Component::protectedFireActionEvent ( long actionId = -1,
const wstring & actionName = L"" )
protected

Fires an action event to registered listeners.

Parameters
actionIdAction identifier.
actionNameName of the action.

◆ protectedFireDataChangedEvent()

void Component::protectedFireDataChangedEvent ( const wstring & oldValue,
const wstring & newValue )
protected

Fires a data changed event to registered listeners.

Parameters
oldValuePrevious data value.
newValueNew data value.

◆ protectedFireItemDoubleClickedEvent()

void Component::protectedFireItemDoubleClickedEvent ( __int64 rowIndex)
protected

Fires a row double-click event to registered listeners.

Parameters
rowIndexIndex of the double-clicked row.

◆ protectedFireSelectionChangedEvent()

void Component::protectedFireSelectionChangedEvent ( long selectionIndex = -1,
const wstring & selectionValue = L"",
BOOL checked = FALSE )
protected

Fires a selection changed event to registered listeners.

Parameters
selectionIndexIndex of the new selection.
selectionValueText of the new selection.
checkedChecked state (for multi-select).

◆ reconfigureScrollBar()

void Component::reconfigureScrollBar ( )

Forces the component to recalculate the scrollbar info.

◆ repaint()

void Component::repaint ( WinHandle hWnd = NULL)

Requests the component to repaint itself.

◆ setEnabled()

void Component::setEnabled ( BOOL bEnable = TRUE)

Enables or disables the component.

Parameters
bEnableTRUE to enable, FALSE to disable.

◆ setFont()

void Component::setFont ( long fontSize,
BOOL isBold = FALSE,
BOOL isItalic = FALSE,
BOOL isUnderlined = FALSE,
const wstring & fontName = L"Arial" )

Sets the font for the component.

Parameters
fontSizeFont size in points.
isBoldTRUE to make font bold.
isItalicTRUE to make font italic.
isUnderlinedTRUE to underline the font.
fontNameName of the font family.

◆ setMouseWheelDelta()

void Component::setMouseWheelDelta ( int delta)

Sets the accumulated mouse wheel delta.

Parameters
deltaMouse wheel delta value.

◆ setParent()

void Component::setParent ( Component * parent)

◆ setScrollbarTopOffset()

virtual void Component::setScrollbarTopOffset ( __int64 firstVisibleRow)
inlinevirtual

Sets the scrollbar's top offset.

Parameters
firstVisibleRowThe first visible row index.

Reimplemented in ButtonGrid, ButtonMenu, CheckList, FluidPanel, Grid, GridPanel, IconMenu, ListBox, Radio, and TreeView.

◆ setVisible()

void Component::setVisible ( BOOL bShow = TRUE)

Shows or hides the component.

Parameters
bShowTRUE to show, FALSE to hide.

◆ showBorder()

void Component::showBorder ( BOOL bShow = TRUE)

◆ startTimer()

void Component::startTimer ( unsigned int timerId,
unsigned int milliseconds )
protected

Starts a timer with the given ID and interval.

Parameters
timerIdIdentifier for the timer.
millisecondsTimer interval in milliseconds.

◆ stopTimer()

void Component::stopTimer ( unsigned int timerId)
protected

Stops the timer identified by timerId.

Parameters
timerIdIdentifier of the timer to stop.

◆ updateScrollbarTopOffset()

void Component::updateScrollbarTopOffset ( __int64 firstVisibleRow)

Updates the scrollbar's top offset based on the current first visible row.

Should be called by components displaying scrollbars.

Parameters
firstVisibleRowThe first visible row index.

◆ windowCreated()

virtual void Component::windowCreated ( )
protectedpure virtual

Abstract method called after the window has been created.

Used to perform any initialization that requires a valid window handle.

Implemented in Accordion, Button, ButtonGrid, ButtonMenu, Calendar, CardPanel, Chart, ChartLegend, CheckBox, CheckComboBox, CheckList, ComboBox, DateTimePicker, Dialog, FluidPanel, Frame, Grid, GridPanel, GridView, IconMenu, Image, Label, ListBox, MaskedField, PickList, ProgressBar, Radio, Rating, Slider, Switch, TabPane, TextArea, TextField, ToggleButton, Toolbar, ToolTip, and TreeView.

Member Data Documentation

◆ _componentType

wstring Component::_componentType
protected

String representing the component type (e.g., "Button", "ComboBox").

◆ _hWnd

WinHandle Component::_hWnd
protected

Handle to the native window associated with this component.

◆ _showBorder

BOOL Component::_showBorder
protected

The documentation for this class was generated from the following file: