13 #include "uibasemod.h" 32 friend class uiTableBody;
50 Interactive, Fixed,
Stretch, ResizeToContents
57 Setup(
int nrrows=-1,
int nrcols=-1)
58 : size_(nrrows,nrcols)
61 , insertrowallowed_(true)
62 , removerowallowed_(true)
64 , insertcolallowed_(true)
65 , removecolallowed_(true)
71 , mincolwdt_(1.f*uiObject::baseFldSize())
73 , maxcolwdt_(2.3f*uiObject::baseFldSize())
75 , selmode_(NoSelection)
76 , removeselallowed_(true)
80 , manualresize_(false)
84 , rightclickdisabled_(false)
86 , enablecopytext_(false)
114 Setup& sizesFixed(
bool yn )
116 insertrowallowed_ = removerowallowed_ = rowgrow_ =
117 insertcolallowed_ = removecolallowed_ = colgrow_ = !yn;
125 const char* text(
const RowCol&)
const;
126 void setText(
const RowCol&,
const char*);
129 void clearCell(
const RowCol&);
132 bool gridShown()
const;
133 void setCurrentCell(
const RowCol&,
bool noselection=
false);
138 void clearCellObject(
const RowCol&);
150 void setPrefHeightInRows(
int);
151 void setPrefWidthInChars(
int);
153 int columnWidth(
int)
const;
154 int rowHeight(
int)
const;
156 void setLeftMargin(
int);
157 void setColumnWidth(
int col,
int w);
158 void setColumnWidthInChar(
int col,
float w);
160 void setTopMargin(
int);
161 void setRowHeight(
int row,
int h);
162 void setRowHeightInChar(
int row,
float h);
164 void resizeHeaderToContents(
bool hor);
165 void resizeColumnToContents(
int);
166 void resizeColumnsToContents();
167 void resizeRowToContents(
int);
168 void resizeRowsToContents();
173 void setColumnStretchable(
int,
bool);
174 void setRowStretchable(
int,
bool);
175 bool isColumnStretchable(
int)
const;
176 bool isRowStretchable(
int)
const;
178 void setTableReadOnly(
bool);
179 bool isTableReadOnly()
const;
181 void setColumnReadOnly(
int,
bool);
182 bool isColumnReadOnly(
int)
const;
183 void setRowReadOnly(
int,
bool);
184 bool isRowReadOnly(
int)
const;
186 void setCellReadOnly(
const RowCol&,
bool);
187 bool isCellReadOnly(
const RowCol&)
const;
189 void hideColumn(
int,
bool);
190 void hideRow(
int,
bool);
191 bool isColumnHidden(
int)
const;
192 bool isRowHidden(
int)
const;
194 bool isTopHeaderHidden()
const;
195 bool isLeftHeaderHidden()
const;
196 void setTopHeaderHidden(
bool);
197 void setLeftHeaderHidden(
bool);
199 void insertRows(
int row,
int count);
201 { insertRows( rc.
row(), count ); }
202 void insertColumns(
int col,
int count);
204 { insertColumns( rc.
col(), count ); }
207 { removeRow( rc.
row() ); }
209 void removeColumn(
int);
211 { removeColumn( rc.
col() ); }
214 bool isSelected(
const RowCol&)
const;
215 bool isRowSelected(
int)
const;
216 bool isColumnSelected(
int)
const;
221 int currentRow()
const;
222 int currentCol()
const;
224 {
return RowCol( currentRow(), currentCol() ); }
225 void setSelected(
const RowCol&,
bool yn=
true);
226 void selectRow(
int row);
227 void selectColumn(
int col);
229 void removeAllSelections();
230 void ensureCellVisible(
const RowCol&);
232 const char* rowLabel(
int)
const;
234 {
return rowLabel(rc.
row()); }
235 void setRowLabel(
int,
const uiString&);
236 void setRowLabels(
const char**);
239 { setRowLabel( rc.
row(), lbl ); }
240 void setRowToolTip(
int,
const uiString&);
241 void setTopLeftCornerLabel(
const uiString&);
243 const char* columnLabel(
int)
const;
245 {
return columnLabel(rc.
col()); }
246 void setColumnLabel(
int,
const uiString&);
247 void setColumnLabels(
const char**);
250 { setColumnLabel( rc.
col(), lbl ); }
251 void setColumnToolTip(
int,
const uiString&);
255 void setDefaultRowLabels();
256 void setDefaultColLabels();
258 void setLabelBGColor(
int,
Color,
bool isrow);
268 {
return seliscols_ ? notifcols_ : notifrows_; }
289 void setHeaderBackground(
int,
const Color&,
bool isrow);
290 Color getHeaderBackground(
int,
bool isrow)
const;
292 int getIntValue(
const RowCol&)
const;
293 double getDValue(
const RowCol&)
const;
294 float getFValue(
const RowCol&)
const;
295 void setValue(
const RowCol&,
int);
296 void setValue(
const RowCol&,
float);
297 void setValue(
const RowCol&,
double);
301 void editCell(
const RowCol&,
bool replace=
false);
307 : firstrow_(-1), lastrow_(-1)
308 , firstcol_(-1), lastcol_(-1) {}
310 int nrRows()
const {
return lastrow_-firstrow_+1; }
311 int nrCols()
const {
return lastcol_-firstcol_+1; }
324 int maxNrOfSelections()
const;
326 bool handleLongTabletPress();
327 bool needOfVirtualKeyboard()
const;
328 void popupVirtualKeyboard(
int globalx=-1,
int globaly=-1);
346 void updateCellSizes(
const uiSize* sz=0);
351 void update(
bool row,
int nr);
360 uiTableBody& mkbody(
uiParent*,
const char*,
int,
int);
367 {
return getDValue( rc ); }
369 {
return getFValue( rc ); }
IdxType & row()
Definition: posidxpair.h:43
void removeColumn(const RowCol &rc)
Definition: uitable.h:210
#define mExpClass(module)
Definition: commondefs.h:157
uiTableBody * body_
Definition: uitable.h:359
Notifier< uiTable > rowInserted
Definition: uitable.h:278
mDeprecated double getdValue(const RowCol &rc) const
Definition: uitable.h:366
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
void insertColumns(const RowCol &rc, int count)
Definition: uitable.h:203
int lastcol_
Definition: uitable.h:317
TypeSet< RowCol > notifcells_
Definition: uitable.h:334
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
Notifier< uiTable > rightClicked
Definition: uitable.h:273
const RowCol & notifiedCell() const
Definition: uitable.h:264
Definition: uistrings.h:22
Notifier< uiTable > selectionDeleted
Definition: uitable.h:280
uiSize lastsz
Definition: uitable.h:363
The base class for most UI elements.
Definition: uiobj.h:35
CNotifier< uiTable, int > rowClicked
Definition: uitable.h:283
Definition: uistring.h:88
TypeSet< int > notifcols_
Definition: uitable.h:336
Definition: uiparent.h:24
Setup(int nrrows=-1, int nrcols=-1)
Definition: uitable.h:57
ResizeMode
Definition: uitable.h:48
Set of BufferString objects.
Definition: bufstringset.h:25
const RowCol & newCell() const
Definition: uitable.h:277
int firstrow_
Definition: uitable.h:313
void setNotifiedCell(const RowCol &rc)
Definition: uitable.h:265
Set of pointers to objects.
Definition: commontypes.h:28
int nrCols() const
Definition: uitable.h:311
const char * rowLabel(const RowCol &rc) const
Definition: uitable.h:233
Notifier< uiTable > valueChanged
Definition: uitable.h:271
RowCol newcell_
Definition: uitable.h:338
ButtonState
Definition: keyenum.h:18
bool istablereadonly_
Definition: uitable.h:353
Notifier< uiTable > rowDeleted
Definition: uitable.h:279
mDeprecated float getfValue(const RowCol &rc) const
Definition: uitable.h:368
OD::ButtonState buttonstate_
Definition: uitable.h:343
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:29
const char * columnLabel(const RowCol &rc) const
Definition: uitable.h:244
void insertRows(const RowCol &rc, int count)
Definition: uitable.h:200
int lastrow_
Definition: uitable.h:314
Notifier< uiTable > colDeleted
Definition: uitable.h:282
Notifier< uiTable > colInserted
Definition: uitable.h:281
Helper class for uiTable to relay Qt's 'activated' messages to uiAction.
Definition: i_qtable.h:30
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:129
CNotifier< uiTable, int > columnClicked
Definition: uitable.h:284
SelectionRange()
Definition: uitable.h:306
Off-screen pixel-based paint device.
Definition: uipixmap.h:33
uiLabel * cornerlabel_
Definition: uitable.h:361
const TypeSet< int > & getNotifRCs() const
Definition: uitable.h:267
Setup setup_
Definition: uitable.h:340
bool seliscols_
Definition: uitable.h:337
multiple ranges of cells.
Definition: uitable.h:39
No cell can be selected by the user.
Definition: uitable.h:37
IdxPair used for its row() and col().
Definition: rowcol.h:23
Setup & setup()
Definition: uitable.h:261
#define mDeprecated
Definition: plfdefs.h:213
IdxType & col()
Definition: posidxpair.h:48
Notifier< uiTable > selectionChanged
Definition: uitable.h:275
int nrRows() const
Definition: uitable.h:310
const Setup & setup() const
Definition: uitable.h:262
void setRowLabel(const RowCol &rc, const uiString &lbl)
Definition: uitable.h:238
RowCol currentCell() const
Definition: uitable.h:223
Notifier< uiTable > leftClicked
Definition: uitable.h:272
void removeRow(const RowCol &rc)
Definition: uitable.h:206
Definition: uitable.h:303
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
int firstcol_
Definition: uitable.h:316
RowCol notifcell_
Definition: uitable.h:333
Definition: uistring.h:235
SelectionBehavior
Definition: uitable.h:43
a single range of cells.
Definition: uitable.h:38
TypeSet< int > notifrows_
Definition: uitable.h:335
SelectionMode
Definition: uitable.h:35
const TypeSet< RowCol > & getNotifCells() const
Definition: uitable.h:269
void setColumnLabel(const RowCol &rc, const uiString &lbl)
Definition: uitable.h:249
Notifier< uiTable > doubleClicked
Definition: uitable.h:274
ObjectSet< SelectionRange > selranges_
Definition: uitable.h:332
HPos
Definition: draw.h:26