A UI component representing a data grid with paging, selection, and editing capabilities.
More...
|
| Grid () |
virtual | ~Grid () |
void | setPager (Pager *pager) |
| Assigns a pager for handling data loading.
|
void | reloadPage () |
void | setStriped (BOOL isStriped) |
void | clear () |
| Clears all rows and resets the grid.
|
vector< GridColumn > | getColumns () |
| Returns all grid columns.
|
void | addColumn (const wstring &name, const wstring &title, BOOL isVisible, UINT widthRatio, long alignment=-1, BOOL isSortable=FALSE, BOOL isFilterable=FALSE, BOOL isEditable=FALSE, const EditType &editStyle=EditType::TEXTFIELD, const vector< wstring > &editOptions={}, const wstring &computedColumnExpression=L"") |
| Adds a new column.
|
void | setColumnEditor (long columnIndex, Component *component) |
| Sets an editor component for a column.
|
Component * | getColumnEditor (long columnIndex) |
| Gets the editor component for a column.
|
__int64 | getRowCount () |
| Returns the number of rows currently loaded.
|
__int64 | getSelectedRow () |
| Returns the index of the currently selected row.
|
__int64 | addRow () |
| Adds a new row and returns its index.
|
void | setCellValue (__int64 rowIndex, long columnIndex, const wstring &value) |
| Sets the value of a specific cell.
|
wstring | getCellValue (__int64 rowIndex, long columnIndex) |
| Gets the value of a specific cell.
|
void | setCellValue (__int64 rowIndex, const wstring &columnName, const wstring &value) |
| Sets the value of a specific cell.
|
wstring | getCellValue (__int64 rowIndex, const wstring &columnName) |
| Gets the value of a specific cell.
|
BOOL | deleteRow (__int64 rowIndex) |
| Deletes a row at the given index.
|
void | onPaint (Graphics *g) override |
| Called to paint the component's client area.
|
void | onWindowResized () override |
| Called when the component's window is resized.
|
void | onArrowUp (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onArrowDown (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onPageUp (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onPageDown (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onKeyHome (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onKeyEnd (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onKeyTab (BOOL shiftPressed, BOOL ctrlPressed) override |
void | onMousePressed (WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed) override |
| Called when the mouse is pressed within the component.
|
BOOL | onMouseWheel (WinHandle hWnd, int x, int y, int delta) override |
| Called when the mouse wheel is used over the component.
|
void | onFocusGained () override |
| Called when the component gains keyboard focus.
|
void | onFocusLost () override |
| Called when the component loses keyboard focus.
|
BOOL | getScrollingInfo (__int64 &scrollMin, __int64 &scrollMax, __int64 &pageSize) override |
| Provides scrolling information if supported.
|
void | setScrollbarTopOffset (__int64 firstVisibleRow) override |
| Sets the scrollbar's top offset.
|
void | addSelectionChangedListener (SelectionChangeListener *l) |
void | addItemDoubleClickedListener (RowDoubleClickListener *l) |
void | addGridChangeListener (GridChangeListener *l) |
| Component () |
| Constructs a new Component instance.
|
virtual | ~Component () |
| Virtual destructor.
|
long | getId () |
| Gets the unique ID assigned to this component.
|
void | setParent (Component *parent) |
Component * | getParent () |
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 | 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 | 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 void | onArrowLeft (BOOL shiftPressed, BOOL ctrlPressed) |
virtual void | onArrowRight (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 | 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 | onTimer (unsigned int timerId) |
| Called on timer events.
|
void | updateScrollbarTopOffset (__int64 firstVisibleRow) |
| Updates the scrollbar's top offset based on the current first visible row.
|
A UI component representing a data grid with paging, selection, and editing capabilities.
Supports paging via an associated Pager object, configurable columns with editors, scrolling, and user interaction through keyboard and mouse.