80 BOOL _fontIsUnderlined;
82 long _lastResizeX, _lastResizeY, _lastResizeWidth, _lastResizeHeight;
84 vector<NumberCollection> _scheduledTimers;
91 void interceptStandardControlEvents(
WinHandle hWndControl);
106 BOOL createNativeWindow(
WinHandle hParent,
Bounds rect,
const wstring& title, UINT windowStyles,
107 const wstring& wndClassName = L
"", BOOL isCustomWndProc = FALSE,
108 long nCmdId = -1, BOOL isVisible = TRUE);
131 virtual BOOL
getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc) = 0;
158 void startTimer(
unsigned int timerId,
unsigned int milliseconds);
229 void setFont(
long fontSize, BOOL isBold = FALSE, BOOL isItalic = FALSE, BOOL isUnderlined = FALSE,
const wstring& fontName = L
"Arial");
258 void moveWindow(
long x,
long y,
long width,
long height, BOOL bRedraw = TRUE);
396 virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed) {}
398 virtual void onPageUp(BOOL shiftPressed, BOOL ctrlPressed) {}
399 virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed) {}
400 virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed) {}
401 virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed) {}
405 virtual void onKeyTyped(
wchar_t ch, BOOL shiftPressed, BOOL ctrlPressed) {}
406 virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed) {}
407 virtual void onKeyEnter(BOOL shiftPressed, BOOL ctrlPressed) {}
408 virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed) {}
409 virtual void onKeyF2(BOOL shiftPressed, BOOL ctrlPressed) {}
410 virtual void onKeyF3(BOOL shiftPressed, BOOL ctrlPressed) {}
411 virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed) {}
412 virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed) {}
413 virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed) {}
414 virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed) {}
415 virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed) {}
416 virtual void onKeyF9(BOOL shiftPressed, BOOL ctrlPressed) {}
417 virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed) {}
418 virtual void onKeyF11(BOOL shiftPressed, BOOL ctrlPressed) {}
419 virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed) {}
444 virtual BOOL
getScrollingInfo(__int64& scrollMin, __int64& scrollMax, __int64& pageSize) {
return FALSE; }
HWND WinHandle
Definition Common.h:16
Definition EventListeners.h:46
virtual void onKeyF9(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:416
virtual void onFocusGained()
Called when the component gains keyboard focus.
Definition Component.h:422
virtual void onTimer(unsigned int timerId)
Called on timer events.
Definition Component.h:432
virtual int getPreferredHeight()
Returns the preferred height of the component.
int getMouseWheelDelta()
Gets the current mouse wheel delta.
virtual BOOL onMouseWheel(WinHandle hWnd, int x, int y, int delta)
Called when the mouse wheel is used over the component.
Definition Component.h:391
virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:413
void GetWindowRect(Bounds &rect)
void setFont(long fontSize, BOOL isBold=FALSE, BOOL isItalic=FALSE, BOOL isUnderlined=FALSE, const wstring &fontName=L"Arial")
Sets the font for the component.
virtual BOOL getScrollingInfo(__int64 &scrollMin, __int64 &scrollMax, __int64 &pageSize)
Provides scrolling information if supported.
Definition Component.h:444
virtual void onSelectionChanged(WinHandle hTarget, int itemIndex, const wstring &itemText, BOOL itemChecked, const ProcParams &procParams)
Called when the selection changes.
Definition Component.h:332
void GetClientRect(Bounds &rect)
wstring _componentType
String representing the component type (e.g., "Button", "ComboBox").
Definition Component.h:115
void protectedFireItemDoubleClickedEvent(__int64 rowIndex)
Fires a row double-click event to registered listeners.
virtual void onWindowMoved()
Called when the component's window is moved.
Definition Component.h:312
virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:408
virtual ~Component()
Virtual destructor.
virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:419
virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:396
virtual void onPaint(Graphics *g)
Called to paint the component's client area.
Definition Component.h:306
virtual void onKeyBackSpace(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:404
virtual void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:397
virtual void windowCreated()=0
Abstract method called after the window has been created.
virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:401
int createComponent(WinHandle hParent, Bounds rect, long nCmd=-1, BOOL isVisible=TRUE)
Creates the component's native window as a child of hParent.
virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:406
BOOL _showBorder
Definition Component.h:117
virtual void onMouseMoved(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse is moved within the component.
Definition Component.h:380
virtual void onWindowResized()
Called when the component's window is resized.
Definition Component.h:309
void clearQueuedPaintRequest()
clears the queued paint request. This function should only be called internally from the library.
virtual void onKeyTyped(wchar_t ch, BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:405
BOOL isWindowCreated()
Returns whether the native window has been created.
virtual void onFocusLost()
Called when the component loses keyboard focus.
Definition Component.h:425
void setMouseWheelDelta(int delta)
Sets the accumulated mouse wheel delta.
virtual void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse is pressed within the component.
Definition Component.h:371
virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:415
void reconfigureScrollBar()
Forces the component to recalculate the scrollbar info.
virtual BOOL onHorzScroll(WinHandle hTarget, const ProcParams &procParams)
Called on horizontal scroll events.
Definition Component.h:350
virtual BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)=0
Abstract method to get window creation options.
void stopTimer(unsigned int timerId)
Stops the timer identified by timerId.
long getActionId()
Returns the component's action command ID.
virtual void onPageUp(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:398
virtual void onArrowRight(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:395
Component()
Constructs a new Component instance.
void doNotSubclass()
Marks this component's native window to avoid subclassing.
virtual void setScrollbarTopOffset(__int64 firstVisibleRow)
Sets the scrollbar's top offset.
Definition Component.h:451
virtual void onKeyDelete(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:403
virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:400
virtual void onAction(WinHandle hTarget, long actionId, const ProcParams &procParams)
Called when an action occurs on the component.
Definition Component.h:321
WinHandle getWindowHandle()
Returns the native WinHandle for this component.
void protectedAddSelectionChangedListener(SelectionChangeListener *l)
Adds a selection change listener.
void protectedFireActionEvent(long actionId=-1, const wstring &actionName=L"")
Fires an action event to registered listeners.
virtual void onKeyF11(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:418
void startTimer(unsigned int timerId, unsigned int milliseconds)
Starts a timer with the given ID and interval.
virtual void onArrowLeft(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:394
virtual BOOL onDrawMeasureItem(LPMEASUREITEMSTRUCT dis, const ProcParams &procParams)
Called when measuring an item for owner-draw controls.
Definition Component.h:359
void protectedAddDataChangedListener(DataChangeListener *l)
Adds a data change listener.
void protectedAddItemDoubleClickedListener(RowDoubleClickListener *l)
Adds a row double-click listener.
virtual void onKeyInsert(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:402
wstring getComponentType()
Gets the component type string.
void updateScrollbarTopOffset(__int64 firstVisibleRow)
Updates the scrollbar's top offset based on the current first visible row.
void protectedAddActionListener(ActionListener *l)
Adds an action listener.
virtual void onKeyF2(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:409
virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:399
virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:411
void showBorder(BOOL bShow=TRUE)
void protectedFireSelectionChangedEvent(long selectionIndex=-1, const wstring &selectionValue=L"", BOOL checked=FALSE)
Fires a selection changed event to registered listeners.
virtual BOOL onDrawItem(LPDRAWITEMSTRUCT dis, const ProcParams &procParams)
Called when drawing an item for owner-draw controls.
Definition Component.h:368
virtual void onMouseRightClicked(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the right mouse button is clicked within the component.
Definition Component.h:377
virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:414
WinHandle _hWnd
Handle to the native window associated with this component.
Definition Component.h:112
void moveWindow(long x, long y, long width, long height, BOOL bRedraw=TRUE)
Moves and resizes the component window.
void setEnabled(BOOL bEnable=TRUE)
Enables or disables the component.
virtual void onKeyEnter(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:407
void protectedFireDataChangedEvent(const wstring &oldValue, const wstring &newValue)
Fires a data changed event to registered listeners.
virtual void onKeyF3(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:410
virtual void onMouseReleased(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse button is released within the component.
Definition Component.h:374
void setVisible(BOOL bShow=TRUE)
Shows or hides the component.
virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:412
virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:417
void repaint(WinHandle hWnd=NULL)
Requests the component to repaint itself.
void setParent(Component *parent)
long getId()
Gets the unique ID assigned to this component.
virtual void onDataChanged(WinHandle hTarget, const wstring &newValue, const ProcParams &procParams)
Called when data changes in the component.
Definition Component.h:341
virtual int getMinimumHeight()
Returns the minimum height the component can have.
Definition EventListeners.h:15
Definition Graphics.h:161
LPARAM lParam
Definition Component.h:13
WinHandle hwnd
Definition Component.h:11
WPARAM wParam
Definition Component.h:12
Definition EventListeners.h:60
Definition EventListeners.h:31