69 __int64 _lastLoadedFirstVisibleRow;
70 __int64 _lastLoadedMaxVisibleRows;
71 __int64 _totalRowCount;
81 vector<GridColumn> _columns;
82 vector<GridRow> _rows;
85 __int64 _firstVisibleRow;
86 __int64 _lastVisibleRow;
97 __int64 _editorRowIndex, _editorColumnIndex;
99 void FixRow(__int64 rowIndex);
100 void LayoutColumns();
103 void LoadPage(BOOL doPaint = TRUE);
105 void SetCurrentCell(__int64 rowIndex,
long columnIndex, BOOL& isNewCellEditable);
108 BOOL FireCellValueChangeEvent(__int64 rowIndex,
const wstring& columnName,
const wstring& oldValue,
const wstring& newValue);
128 void addColumn(
const wstring& name,
const wstring& title, BOOL isVisible, UINT widthRatio,
long alignment = -1,
129 BOOL isSortable = FALSE, BOOL isFilterable = FALSE, BOOL isEditable = FALSE,
131 const vector<wstring>& editOptions = {},
132 const wstring& computedColumnExpression = L
"");
141 void setCellValue(__int64 rowIndex,
long columnIndex,
const wstring& value);
143 void setCellValue(__int64 rowIndex,
const wstring& columnName,
const wstring& value);
153 void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
155 void onPageUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
156 void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
override;
157 void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
override;
158 void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
override;
159 void onKeyTab(BOOL shiftPressed, BOOL ctrlPressed)
override;
HWND WinHandle
Definition Common.h:16
EditType
Definition Common.h:147
@ TEXTFIELD
Definition Common.h:148
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:171
Definition EventListeners.h:82
BOOL _isSortable
Definition Grid.h:36
BOOL _isFilterable
Definition Grid.h:37
vector< wstring > _editOptions
Definition Grid.h:41
BOOL _isEditable
Definition Grid.h:38
long _calculatedWidth
Definition Grid.h:31
long _alignment
Definition Grid.h:29
wstring _name
Definition Grid.h:28
wstring _computedColumnExpression
Definition Grid.h:39
int _columnEndX
Definition Grid.h:32
GridColumn()
Definition Grid.h:15
EditType _editStyle
Definition Grid.h:40
long _widthRatio
Definition Grid.h:30
Bounds _sortIndicatorRect
Definition Grid.h:33
wstring _title
Definition Grid.h:28
BOOL _isVisible
Definition Grid.h:35
int _columnStartX
Definition Grid.h:32
Component * _editor
Definition Grid.h:42
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.
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
__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 scrollBarActivity(__int64 firstVisibleItem)
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 onMouseMoved(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse is moved within the component.
void onWindowResized() override
Called when the component's window is resized.
void onMouseReleased(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse button is released within the component.
vector< wstring > _values
Definition Grid.h:48
Bounds _rect
Definition Grid.h:49
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