CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxUITableView.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxUIBaseView.h"
22
23
25{
26 virtual int rowCount( const CFxUIModelIndex &parent = CFxUIModelIndex() ) const = 0;
27 virtual int columnCount( const CFxUIModelIndex &parent = CFxUIModelIndex() ) const = 0;
29
30protected:
31 virtual CFxUIModelIndex index( int row, int column, const CFxUIModelIndex &parent = CFxUIModelIndex() ) const override;
32 virtual CFxUIModelIndex parent( const CFxUIModelIndex &child ) const override;
33};
34
42
46
48{
49public:
50
60
75
87
92 NoUpdate = 0x0000,
93 Clear = 0x0001,
94 Select = 0x0002,
95 Deselect = 0x0004,
96 Rows = 0x0020,
97 Columns = 0x0040,
99 };
100
102 {
103 None = 0,
104 Left = 1,
105 Middle = 2,
106 Right = 4
107 };
108
109public:
110
113
116
125
132
139
146
153
159 void setSortingEnabled( bool bEnable );
160
167 void sortByColumn( int column, int order );
168
175
182
190 void setColumnWidth( int iColumn, int iWidth );
191
197 int columnWidth( int iColumn ) const;
198
205
207
214
221
226
230 std::vector<CFxUIModelIndex> selectedIndexes() const;
231
240
241
247 void setVerticalHeaderHidden( bool bHide );
248
254 void setHorzHeaderHidden( bool bHide );
255
261 void setHorzScrollBarDisable( bool bDisable );
262
270 void setColumnHidden( int iColumn, bool bHide );
271
278
283
292
301
307 bool showGrid();
308
309 //...
310
311};
312
316
#define COMMONUI_API
CFxUISortOrder
@ DescendingOrder
@ AscendingOrder
CFxUIAbstractItemModel(CFxUIObject *parent=nullptr)
virtual int columnCount(const CFxUIModelIndex &parent=CFxUIModelIndex()) const =0
virtual int rowCount(const CFxUIModelIndex &parent=CFxUIModelIndex()) const =0
virtual CFxUIModelIndex parent(const CFxUIModelIndex &child) const override
virtual CFxUIModelIndex index(int row, int column, const CFxUIModelIndex &parent=CFxUIModelIndex()) const override
void setSelectionBehavior(CFxUITableView::UISelectionBehavior behavior)
CFxUISignal< void(CFxUIModelIndex, CFxUITableView::UIMouseClickEvent)> & mouseClicked()
void sortByColumn(int column, int order)
void setColumnWidth(int iColumn, int iWidth)
CFxUIModelIndex currentIndex() const
void setColumnHidden(int iColumn, bool bHide)
CFxUIAbstractItemModel * getModel()
void setVerticalHeaderHidden(bool bHide)
@ NoSelection
Items cannot be selected.
@ SingleSelection
When the user selects an item, any already-selected item becomes unselected, and the user cannot unse...
@ ContiguousSelection
If the user presses the Shift key while clicking on an item, all items between the current item and t...
@ MultiSelection
When the user selects an item in the usual way, the selection status of that item is toggled and the ...
CFxUISignal< void(void)> & selectionChanged()
void setHorzHeaderHidden(bool bHide)
@ SelectColumns
This enum selects only the columns.
@ SelectItems
This enum selects the single items.
@ SelectRows
This enum selects only the rows.
@ Right
Right button.
@ Middle
Middle button.
@ Left
Left button.
@ None
No button.
CFxUISignal< void(const CFxUIModelIndex &)> & itemClicked()
void openPersistentEditor(const CFxUIModelIndex &index)
void setSortingEnabled(bool bEnable)
std::vector< CFxUIModelIndex > selectedIndexes() const
void setSelectionMode(CFxUITableView::UISelectionMode mode)
void setModel(CFxUIAbstractItemModel *model)
void setShowGrid(bool visible, int mask=CFxUIModelIndex::Horizontal|CFxUIModelIndex::Vertical)
@ ClearAndSelect
A combination of Clear and Select, provided for convenience.
@ NoUpdate
No selection will be made.
@ Deselect
All specified indexes will be deselected.
@ Rows
All indexes will be expanded to span rows.
@ Columns
All indexes will be expanded to span columns.
@ Clear
The complete selection will be cleared.
@ Select
All specified indexes will be selected.
void setHorizontalHeaderStretchLastSection(bool bEnable)
void clearSelection()
int columnWidth(int iColumn) const
void setCurrentIndex(CFxUIModelIndex index)
@ Custom
Use Fixed instead.
@ Fixed
The user cannot resize the section.
@ Stretch
HeaderView will automatically resize the section to fill the available space.
@ ResizeToContents
HeaderView will automatically resize the section to its optimal size based on the contents of the ent...
@ Interactive
The user can resize the section.
void selectRow(CFxUITableView::UISelectionFlag flag, CFxUIModelIndex index)
void setHorzScrollBarDisable(bool bDisable)
void setHorizontalHeaderResizeSection(CFxUITableView::UIHeaderResizeMode mode, int iColumn)
void setVerticalHeaderStretchLastSection(bool bEnable)
void setVerticalScrollBarPolicy(CFxUIBaseView::UIScrollBarPolicy mode)
void setHorizontalScrollBarPolicy(CFxUIBaseView::UIScrollBarPolicy mode)
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition gles2_ext.h:110
GLuint index
Definition gles2_ext.h:265
GLenum GLint GLuint mask
Definition gles2_ext.h:262