15 #include "uibasemod.h" 33 friend class uiTableBody;
51 Interactive, Fixed,
Stretch, ResizeToContents
58 Setup(
int nrrows=-1,
int nrcols=-1)
59 : size_(nrrows,nrcols)
62 , insertrowallowed_(true)
63 , removerowallowed_(true)
65 , insertcolallowed_(true)
66 , removecolallowed_(true)
72 , mincolwdt_(1.f*uiObject::baseFldSize())
74 , maxcolwdt_(2.3f*uiObject::baseFldSize())
76 , selmode_(NoSelection)
77 , removeselallowed_(true)
81 , manualresize_(false)
85 , rightclickdisabled_(false)
87 , enablecopytext_(false)
115 Setup& sizesFixed(
bool yn )
117 insertrowallowed_ = removerowallowed_ = rowgrow_ =
118 insertcolallowed_ = removecolallowed_ = colgrow_ = !yn;
126 const char* text(
const RowCol&)
const;
127 void setText(
const RowCol&,
const char*);
130 void clearCell(
const RowCol&);
133 bool gridShown()
const;
134 void setCurrentCell(
const RowCol&,
bool noselection=
false);
139 void clearCellObject(
const RowCol&);
146 void setCellChecked(
const RowCol&,
bool yn);
147 bool isCellChecked(
const RowCol&)
const;
153 void setPrefHeightInRows(
int);
155 int columnWidth(
int)
const;
156 int rowHeight(
int)
const;
158 void setLeftMargin(
int);
159 void setColumnWidth(
int col,
int w);
160 void setColumnWidthInChar(
int col,
float w);
162 void setTopMargin(
int);
163 void setRowHeight(
int row,
int h);
164 void setRowHeightInChar(
int row,
float h);
166 void resizeHeaderToContents(
bool hor);
167 void resizeColumnToContents(
int);
168 void resizeColumnsToContents();
169 void resizeRowToContents(
int);
170 void resizeRowsToContents();
175 void setColumnStretchable(
int,
bool);
176 void setRowStretchable(
int,
bool);
177 bool isColumnStretchable(
int)
const;
178 bool isRowStretchable(
int)
const;
180 void setTableReadOnly(
bool);
181 bool isTableReadOnly()
const;
183 void setColumnReadOnly(
int,
bool);
184 bool isColumnReadOnly(
int)
const;
185 void setRowReadOnly(
int,
bool);
186 bool isRowReadOnly(
int)
const;
188 void setCellReadOnly(
const RowCol&,
bool);
189 bool isCellReadOnly(
const RowCol&)
const;
191 void hideColumn(
int,
bool);
192 void hideRow(
int,
bool);
193 bool isColumnHidden(
int)
const;
194 bool isRowHidden(
int)
const;
196 bool isTopHeaderHidden()
const;
197 bool isLeftHeaderHidden()
const;
198 void setTopHeaderHidden(
bool);
199 void setLeftHeaderHidden(
bool);
201 void insertRows(
int row,
int count);
203 { insertRows( rc.
row(), count ); }
204 void insertColumns(
int col,
int count);
206 { insertColumns( rc.
col(), count ); }
209 { removeRow( rc.
row() ); }
211 void removeColumn(
int);
213 { removeColumn( rc.
col() ); }
216 bool isSelected(
const RowCol&)
const;
217 bool isRowSelected(
int)
const;
218 bool isColumnSelected(
int)
const;
223 int currentRow()
const;
224 int currentCol()
const;
226 {
return RowCol( currentRow(), currentCol() ); }
227 void setSelected(
const RowCol&,
bool yn=
true);
228 void selectRow(
int row);
229 void selectColumn(
int col);
231 void removeAllSelections();
232 void ensureCellVisible(
const RowCol&);
234 const char* rowLabel(
int)
const;
236 {
return rowLabel(rc.
row()); }
237 void setRowLabel(
int,
const char*);
238 void setRowLabels(
const char**);
241 { setRowLabel( rc.
row(), lbl ); }
242 void setRowToolTip(
int,
const char*);
243 void setTopLeftCornerLabel(
const uiString&);
245 const char* columnLabel(
int)
const;
247 {
return columnLabel(rc.
col()); }
248 void setColumnLabel(
int,
const uiString&);
249 void setColumnLabels(
const char**);
252 { setColumnLabel( rc.
col(), lbl ); }
253 void setColumnToolTip(
int,
const uiString&);
257 void setDefaultRowLabels();
258 void setDefaultColLabels();
260 void setLabelBGColor(
int,
Color,
bool isrow);
270 {
return seliscols_ ? notifcols_ : notifrows_; }
291 void setHeaderBackground(
int,
const Color&,
bool isrow);
292 Color getHeaderBackground(
int,
bool isrow)
const;
294 int getIntValue(
const RowCol&)
const;
295 double getDValue(
const RowCol&)
const;
296 float getFValue(
const RowCol&)
const;
297 void setValue(
const RowCol&,
int);
298 void setValue(
const RowCol&,
float);
299 void setValue(
const RowCol&,
float,
int nrdec);
300 void setValue(
const RowCol&,
double);
301 void setValue(
const RowCol&,
double,
int nrdec);
305 void editCell(
const RowCol&,
bool replace=
false);
311 : firstrow_(-1), lastrow_(-1)
312 , firstcol_(-1), lastcol_(-1) {}
314 int nrRows()
const {
return lastrow_-firstrow_+1; }
315 int nrCols()
const {
return lastcol_-firstcol_+1; }
328 int maxNrOfSelections()
const;
330 bool handleLongTabletPress();
331 bool needOfVirtualKeyboard()
const;
332 void popupVirtualKeyboard(
int globalx=-1,
int globaly=-1);
350 void updateCellSizes(
const uiSize* sz=0);
355 void update(
bool row,
int nr);
362 uiTableBody& mkbody(
uiParent*,
const char*,
int,
int);
369 {
return getDValue( rc ); }
371 {
return getFValue( rc ); }
373 void setPrefWidthInChars(
int);
IdxType & row()
Definition: posidxpair.h:45
void removeColumn(const RowCol &rc)
Definition: uitable.h:212
#define mExpClass(module)
Definition: commondefs.h:160
uiTableBody * body_
Definition: uitable.h:361
Notifier< uiTable > rowInserted
Definition: uitable.h:280
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
void insertColumns(const RowCol &rc, int count)
Definition: uitable.h:205
int lastcol_
Definition: uitable.h:321
TypeSet< RowCol > notifcells_
Definition: uitable.h:338
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Notifier< uiTable > rightClicked
Definition: uitable.h:275
void setRowLabel(const RowCol &rc, const char *lbl)
Definition: uitable.h:240
const RowCol & notifiedCell() const
Definition: uitable.h:266
double getdValue(const RowCol &rc) const
Definition: uitable.h:368
Notifier< uiTable > selectionDeleted
Definition: uitable.h:282
uiSize lastsz
Definition: uitable.h:365
The base class for most UI elements.
Definition: uiobj.h:38
CNotifier< uiTable, int > rowClicked
Definition: uitable.h:285
Definition: uistring.h:89
TypeSet< int > notifcols_
Definition: uitable.h:340
Definition: uiparent.h:26
Setup(int nrrows=-1, int nrcols=-1)
Definition: uitable.h:58
ResizeMode
Definition: uitable.h:49
Set of BufferString objects.
Definition: bufstringset.h:28
const RowCol & newCell() const
Definition: uitable.h:279
int firstrow_
Definition: uitable.h:317
void setNotifiedCell(const RowCol &rc)
Definition: uitable.h:267
Set of pointers to objects.
Definition: commontypes.h:32
int nrCols() const
Definition: uitable.h:315
const char * rowLabel(const RowCol &rc) const
Definition: uitable.h:235
Notifier< uiTable > valueChanged
Definition: uitable.h:273
RowCol newcell_
Definition: uitable.h:342
ButtonState
Definition: keyenum.h:20
bool istablereadonly_
Definition: uitable.h:357
Notifier< uiTable > rowDeleted
Definition: uitable.h:281
OD::ButtonState buttonstate_
Definition: uitable.h:347
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
const char * columnLabel(const RowCol &rc) const
Definition: uitable.h:246
void insertRows(const RowCol &rc, int count)
Definition: uitable.h:202
HPos
Definition: draw.h:26
int lastrow_
Definition: uitable.h:318
Notifier< uiTable > colDeleted
Definition: uitable.h:284
Notifier< uiTable > colInserted
Definition: uitable.h:283
Helper class for uiTable to relay Qt's 'activated' messages to uiAction.
Definition: i_qtable.h:31
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
CNotifier< uiTable, int > columnClicked
Definition: uitable.h:286
SelectionRange()
Definition: uitable.h:310
Off-screen pixel-based paint device.
Definition: uipixmap.h:34
uiLabel * cornerlabel_
Definition: uitable.h:363
const TypeSet< int > & getNotifRCs() const
Definition: uitable.h:269
Setup setup_
Definition: uitable.h:344
bool seliscols_
Definition: uitable.h:341
multiple ranges of cells.
Definition: uitable.h:40
No cell can be selected by the user.
Definition: uitable.h:38
IdxPair used for its row() and col().
Definition: rowcol.h:25
Setup & setup()
Definition: uitable.h:263
IdxType & col()
Definition: posidxpair.h:50
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Notifier< uiTable > selectionChanged
Definition: uitable.h:277
int nrRows() const
Definition: uitable.h:314
const Setup & setup() const
Definition: uitable.h:264
RowCol currentCell() const
Definition: uitable.h:225
float getfValue(const RowCol &rc) const
Definition: uitable.h:370
Notifier< uiTable > leftClicked
Definition: uitable.h:274
void removeRow(const RowCol &rc)
Definition: uitable.h:208
Definition: uitable.h:307
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
int firstcol_
Definition: uitable.h:320
RowCol notifcell_
Definition: uitable.h:337
SelectionBehavior
Definition: uitable.h:44
a single range of cells.
Definition: uitable.h:39
TypeSet< int > notifrows_
Definition: uitable.h:339
SelectionMode
Definition: uitable.h:36
const TypeSet< RowCol > & getNotifCells() const
Definition: uitable.h:271
void setColumnLabel(const RowCol &rc, const uiString &lbl)
Definition: uitable.h:251
Notifier< uiTable > doubleClicked
Definition: uitable.h:276
ObjectSet< SelectionRange > selranges_
Definition: uitable.h:336