80 BOOL _fontIsUnderlined;
82 long _lastResizeX, _lastResizeY, _lastResizeWidth, _lastResizeHeight;
84 vector<NumberCollection> _scheduledTimers;
91 void interceptStandardControlEvents(
WinHandle hWndControl);
106 BOOL createNativeWindow(
Component *parent,
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);
234 void setFont(
long fontSize, BOOL isBold = FALSE, BOOL isItalic = FALSE, BOOL isUnderlined = FALSE,
const wstring& fontName = L
"Arial");
236 BOOL
getCustomFont(
long& fontSize, BOOL& isBold, BOOL& isItalic, BOOL& isUnderlined, wstring& fontName);
265 void moveWindow(
long x,
long y,
long width,
long height, BOOL bRedraw = TRUE);
310 virtual BOOL
getChildren(vector<Component*>& children) {
return FALSE; };
381 virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed) {}
383 virtual void onPageUp(BOOL shiftPressed, BOOL ctrlPressed) {}
384 virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed) {}
385 virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed) {}
386 virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed) {}
390 virtual void onKeyTyped(
wchar_t ch, BOOL shiftPressed, BOOL ctrlPressed) {}
391 virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed) {}
392 virtual void onKeyEnter(BOOL shiftPressed, BOOL ctrlPressed) {}
393 virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed) {}
394 virtual void onKeyF2(BOOL shiftPressed, BOOL ctrlPressed) {}
395 virtual void onKeyF3(BOOL shiftPressed, BOOL ctrlPressed) {}
396 virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed) {}
397 virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed) {}
398 virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed) {}
399 virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed) {}
400 virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed) {}
401 virtual void onKeyF9(BOOL shiftPressed, BOOL ctrlPressed) {}
402 virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed) {}
403 virtual void onKeyF11(BOOL shiftPressed, BOOL ctrlPressed) {}
404 virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed) {}
429 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:401
virtual BOOL getChildren(vector< Component * > &children)
Definition Component.h:310
virtual void onFocusGained()
Called when the component gains keyboard focus.
Definition Component.h:407
virtual void onTimer(unsigned int timerId)
Called on timer events.
Definition Component.h:417
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:376
Component * getTopLevelParent()
virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:398
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:429
virtual void onSelectionChanged(WinHandle hTarget, int itemIndex, const wstring &itemText, BOOL itemChecked, const ProcParams &procParams)
Called when the selection changes.
Definition Component.h:341
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.
int createComponent(Component *parent, Bounds rect, long nCmd=-1, BOOL isVisible=TRUE)
Creates the component's native window as a child of hParent.
virtual void onWindowMoved()
Called when the component's window is moved.
Definition Component.h:321
virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:393
virtual ~Component()
Virtual destructor.
virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:404
virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:381
BOOL getCustomFont(long &fontSize, BOOL &isBold, BOOL &isItalic, BOOL &isUnderlined, wstring &fontName)
virtual void onPaint(Graphics *g)
Called to paint the component's client area.
Definition Component.h:315
virtual void onKeyBackSpace(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:389
virtual void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:382
virtual void windowCreated()=0
Abstract method called after the window has been created.
virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:386
virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:391
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:365
virtual void onWindowResized()
Called when the component's window is resized.
Definition Component.h:318
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:390
BOOL isWindowCreated()
Returns whether the native window has been created.
virtual void onFocusLost()
Called when the component loses keyboard focus.
Definition Component.h:410
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:356
virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:400
void reconfigureScrollBar()
Forces the component to recalculate the scrollbar info.
virtual BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)=0
Abstract method to get window creation options.
void repaint(Component *comp=NULL, BOOL repaintImmediately=FALSE)
Requests the component to repaint itself.
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:383
virtual void onArrowRight(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:380
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:436
virtual void onKeyDelete(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:388
virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:385
virtual void onAction(WinHandle hTarget, long actionId, const ProcParams &procParams)
Called when an action occurs on the component.
Definition Component.h:330
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:403
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:379
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:387
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:394
virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:384
virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:396
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 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:362
virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:399
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:392
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:395
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:359
void setVisible(BOOL bShow=TRUE)
Shows or hides the component.
virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:397
virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:402
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:350
virtual int getMinimumHeight()
Returns the minimum height the component can have.
Definition EventListeners.h:15
Definition Graphics.h:171
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