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);
137 virtual BOOL
getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc) = 0;
164 void startTimer(
unsigned int timerId,
unsigned int milliseconds);
240 void setFont(
long fontSize, BOOL isBold = FALSE, BOOL isItalic = FALSE, BOOL isUnderlined = FALSE,
const wstring& fontName = L
"Arial");
242 BOOL
getCustomFont(
long& fontSize, BOOL& isBold, BOOL& isItalic, BOOL& isUnderlined, wstring& fontName);
273 void moveWindow(
long x,
long y,
long width,
long height, BOOL bRedraw = TRUE);
313 virtual BOOL
getChildren(vector<Component*>& children) {
return FALSE; };
384 virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed) {}
386 virtual void onPageUp(BOOL shiftPressed, BOOL ctrlPressed) {}
387 virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed) {}
388 virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed) {}
389 virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed) {}
393 virtual void onKeyTyped(
wchar_t ch, BOOL shiftPressed, BOOL ctrlPressed) {}
394 virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed) {}
395 virtual void onKeyEnter(BOOL shiftPressed, BOOL ctrlPressed) {}
396 virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed) {}
397 virtual void onKeyF2(BOOL shiftPressed, BOOL ctrlPressed) {}
398 virtual void onKeyF3(BOOL shiftPressed, BOOL ctrlPressed) {}
399 virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed) {}
400 virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed) {}
401 virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed) {}
402 virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed) {}
403 virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed) {}
404 virtual void onKeyF9(BOOL shiftPressed, BOOL ctrlPressed) {}
405 virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed) {}
406 virtual void onKeyF11(BOOL shiftPressed, BOOL ctrlPressed) {}
407 virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed) {}
HWND WinHandle
Definition Common.h:16
Definition EventListeners.h:46
virtual void onKeyF9(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:404
virtual BOOL getChildren(vector< Component * > &children)
Definition Component.h:313
virtual void onFocusGained()
Called when the component gains keyboard focus.
Definition Component.h:410
virtual void onTimer(unsigned int timerId)
Called on timer events.
Definition Component.h:420
virtual int getPreferredHeight()
Returns the preferred height of the component.
BOOL _isVisible
Definition Component.h:119
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:379
Component * getTopLevelParent()
virtual void onKeyF6(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:401
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 void onSelectionChanged(WinHandle hTarget, int itemIndex, const wstring &itemText, BOOL itemChecked, const ProcParams &procParams)
Called when the selection changes.
Definition Component.h:344
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.
void setAlignment(long alignment)
virtual void onWindowMoved()
Called when the component's window is moved.
Definition Component.h:324
virtual void onKeyF1(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:396
virtual ~Component()
Virtual destructor.
virtual void onKeyF12(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:407
virtual void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:384
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:318
virtual void onKeyBackSpace(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:392
virtual void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:385
virtual void windowCreated()=0
Abstract method called after the window has been created.
virtual void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:389
virtual void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:394
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:368
virtual void onWindowResized()
Called when the component's window is resized.
Definition Component.h:321
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:393
BOOL isWindowCreated()
Returns whether the native window has been created.
virtual void onFocusLost()
Called when the component loses keyboard focus.
Definition Component.h:413
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:359
virtual void onKeyF8(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:403
virtual BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)=0
Abstract method to get window creation options.
BOOL _lastItemIsPartiallyVisible
Definition Component.h:123
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:386
virtual void onArrowRight(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:383
Component()
Constructs a new Component instance.
void doNotSubclass()
Marks this component's native window to avoid subclassing.
long _alignment
Definition Component.h:121
virtual void onKeyDelete(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:391
virtual void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:388
virtual void onAction(WinHandle hTarget, long actionId, const ProcParams &procParams)
Called when an action occurs on the component.
Definition Component.h:333
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:406
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:382
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:390
wstring getComponentType()
Gets the component type string.
void protectedAddActionListener(ActionListener *l)
Adds an action listener.
virtual void onKeyF2(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:397
virtual void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:387
virtual void onKeyF4(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:399
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:365
virtual void onKeyF7(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:402
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:395
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:398
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:362
void setVisible(BOOL bShow=TRUE)
Shows or hides the component.
virtual void onKeyF5(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:400
virtual void onKeyF10(BOOL shiftPressed, BOOL ctrlPressed)
Definition Component.h:405
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:353
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