66 __int64 _totalRowCount;
76 vector<GridColumn> _columns;
77 vector<GridRow> _rows;
80 __int64 _firstVisibleRow;
81 __int64 _lastVisibleRow;
91 long _currentCellEditorStyle;
92 __int64 _editorRowIndex, _editorColumnIndex;
94 void FixRow(__int64 rowIndex);
98 void LoadPage(BOOL doPaint = TRUE);
100 void SetCurrentCell(__int64 rowIndex,
long columnIndex, BOOL& isNewCellEditable);
103 BOOL FireCellValueChangeEvent(__int64 rowIndex,
const wstring& columnName,
const wstring& oldValue,
const wstring& newValue);
121 void addColumn(
const wstring& name,
const wstring& title, BOOL isVisible, UINT widthRatio,
long alignment = -1,
122 BOOL isSortable = FALSE, BOOL isFilterable = FALSE, BOOL isEditable = FALSE,
124 const vector<wstring>& editOptions = {},
125 const wstring& computedColumnExpression = L
"");
134 void setCellValue(__int64 rowIndex,
long columnIndex,
const wstring& value);
136 void setCellValue(__int64 rowIndex,
const wstring& columnName,
const wstring& value);
146 void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
148 void onPageUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
149 void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
override;
150 void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
override;
151 void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
override;
152 void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed)
override;
HWND WinHandle
Definition Common.h:16
EditType
Definition Common.h:139
@ TEXTFIELD
Definition Common.h:140
SortType
Definition Models.h:6
A UI component that allows users to select a single item from a dropdown list.
Definition ComboBox.h:13
Base class for all UI components providing window creation, event handling, and listener management.
Definition Component.h:32
Component()
Constructs a new Component instance.
Definition Graphics.h:161
Definition EventListeners.h:82
BOOL _isSortable
Definition Grid.h:35
BOOL _isFilterable
Definition Grid.h:36
vector< wstring > _editOptions
Definition Grid.h:40
BOOL _isEditable
Definition Grid.h:37
long _calculatedWidth
Definition Grid.h:30
long _alignment
Definition Grid.h:28
wstring _name
Definition Grid.h:27
wstring _computedColumnExpression
Definition Grid.h:38
int _columnEndX
Definition Grid.h:31
GridColumn()
Definition Grid.h:14
EditType _editStyle
Definition Grid.h:39
long _widthRatio
Definition Grid.h:29
Bounds _sortIndicatorRect
Definition Grid.h:32
wstring _title
Definition Grid.h:27
BOOL _isVisible
Definition Grid.h:34
int _columnStartX
Definition Grid.h:31
Component * _editor
Definition Grid.h:41
void setCellValue(__int64 rowIndex, const wstring &columnName, const wstring &value)
Sets the value of a specific cell.
void setPager(Pager *pager)
Assigns a pager for handling data loading.
void addGridChangeListener(GridChangeListener *l)
void clear()
Clears all rows and resets the grid.
wstring getCellValue(__int64 rowIndex, long columnIndex)
Gets the value of a specific cell.
void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed) override
__int64 getRowCount()
Returns the number of rows currently loaded.
vector< GridColumn > getColumns()
Returns all grid columns.
BOOL getScrollingInfo(__int64 &scrollMin, __int64 &scrollMax, __int64 &pageSize) override
Provides scrolling information if supported.
void onPaint(Graphics *g) override
Called to paint the component's client area.
void setCellValue(__int64 rowIndex, long columnIndex, const wstring &value)
Sets the value of a specific cell.
void onPageUp(BOOL shiftPressed, BOOL ctrlPressed) override
Component * getColumnEditor(long columnIndex)
Gets the editor component for a column.
wstring getCellValue(__int64 rowIndex, const wstring &columnName)
Gets the value of a specific cell.
void onPageDown(BOOL shiftPressed, BOOL ctrlPressed) override
void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed) override
void onFocusLost() override
Called when the component loses keyboard focus.
void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed) override
void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed) override
void setScrollbarTopOffset(__int64 firstVisibleRow) override
Sets the scrollbar's top offset.
__int64 addRow()
Adds a new row and returns its index.
void setColumnEditor(long columnIndex, Component *component)
Sets an editor component for a column.
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.
BOOL onMouseWheel(WinHandle hWnd, int x, int y, int delta) override
Called when the mouse wheel is used over the component.
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 deleteRow(__int64 rowIndex)
Deletes a row at the given index.
void windowCreated() override
Abstract method called after the window has been created.
void addItemDoubleClickedListener(RowDoubleClickListener *l)
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc) override
Abstract method to get window creation options.
void addSelectionChangedListener(SelectionChangeListener *l)
void setStriped(BOOL isStriped)
void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed) override
__int64 getSelectedRow()
Returns the index of the currently selected row.
void onFocusGained() override
Called when the component gains keyboard focus.
void onWindowResized() override
Called when the component's window is resized.
vector< wstring > _values
Definition Grid.h:47
Bounds _rect
Definition Grid.h:48
Input field that supports input masking and numeric input.
Definition MaskedField.h:15
Definition EventListeners.h:60
Definition EventListeners.h:31
A text input field component.
Definition TextField.h:9