home
 
 index of namespace ui
 
 index of project tkui
 
 index of module MTableModel

Class MTableModel.ui::TableModel


SynopsisA TableModel is assigned to exactly one TableView. TableModels are used to query cell attributes like values, renderers and editors.

  Derived classes:
  Methods:
  Constants:
Method alignViewPixelOffsetY
Align first resp. last row to border (depending on move direction).
Signature
alignViewPixelOffsetY(intmoveDir)
Arguments
intmoveDir

 
 top of page
Method calcMinimumWidth
Return the minimum width (sum of all columns)
Signature
calcMinimumWidth():int
Returns
int

 
 top of page
Method calcPreferredColumnWidths
Signature
calcPreferredColumnWidths()

 
 top of page
Method calcPreferredColumnWidthsByCaption
Signature
calcPreferredColumnWidthsByCaption()

 
 top of page
Method calcRowPixelYOffsets
Signature
calcRowPixelYOffsets():int
Returns
int

 
 top of page
Method calcViewOffsetY
Signature
calcViewOffsetY(intdir)
Arguments
intdir

 
 top of page
Method centerRow
Adjust scroll offset so that the currently selected row is shown centered
Signature
centerRow()

 
 top of page
Method compareCells
Compare cell values and return -1 if _rowA precedes _rowB, 1 if _rowB precedes _rowA and 0 if the cell values are equal. Used by the table sorter. The default behaviour is to compare the cell string values. In case a column stores e.g. a timestamp you may want to implement a custom comparison.
Signature
compareCells(intcol,
  introwA,
  introwB 
  )  
 :int
Arguments
intcol
introwA
introwB
Returns
int

 
 top of page
Method decVisibleCursorIndex
Signature
decVisibleCursorIndex()

 
 top of page
Method editColumnAtX
Signature
editColumnAtX(floatx)
 :int
Arguments
floatx
Returns
int

 
 top of page
Method getCellCaption
Return string representation of the respective cell value. Used in conjunction with the default cell renderer and the default @compareCells implementation.
Signature
getCellCaption(intcol,
  introw 
  )  
 :String
Arguments
intcol
introw
Returns
String

 
 top of page
Method getCellEditor
Return custom cell editor or null (= cell not editable). The returned editor will be displayed in a frameless modal dialog. If a value has been entered (and the editor was not canceled) the setCellValue() method will be called with the new value.
Signature
getCellEditor(intcol,
  introw 
  )  
 :ui::TableCellEditor
Arguments
intcol
introw
Returns

 
 top of page
Method getCellIcon
Return icon for the respective cell value. Used in conjunction with the default cell renderer. Must return null if the cell has no icon.
Signature
getCellIcon(intcol,
  introw 
  )  
 :ui::Icon
Arguments
intcol
introw
Returns

 
 top of page
Method getCellPosition
Signature
getCellPosition(intcol,
  introw,
  ui::Point2fret 
  )  
Arguments
intcol
introw
ui::Point2fret

 
 top of page
Method getCellRenderer
Return cell renderer layer. The cell renderer should have been updated with the current cell value before it is returned. The geometry of the renderer will be set by the caller. The default behaviour is to call @getCellCaption and @getCellIconName and use a Label to display the cell content.
Signature
getCellRenderer(intcol,
  introw,
  intvisibleRow 
  )  
 :ui::Layer
Arguments
intcol
introw
intvisibleRow
Returns

 
 top of page
Method getCellToolTipCaption
Signature
getCellToolTipCaption(intcol,
  introw 
  )  
 :String
Arguments
intcol
introw
Returns
String

 
 top of page
Method getColumnAtX
Signature
getColumnAtX(floatx)
 :int
Arguments
floatx
Returns
int

 
 top of page
Method getColumnCaption
Return the caption for the given column.
Signature
getColumnCaption(intcol)
 :String
Arguments
intcol
Returns
String

 
 top of page
Method getColumnIcon
Return the icon name for the given column. Must return null if the column has no icon.
Signature
getColumnIcon(intcol)
 :String
Arguments
intcol
Returns
String

 
 top of page
Method getColumnWidth
Return the column width (pixels). Used for the column header and to calculate cell positions.
Signature
getColumnWidth(intcol)
 :int
Arguments
intcol
Returns
int

 
 top of page
Method getContextMenuOffsetX
Signature
getContextMenuOffsetX(intbKeyboard)
 :int
Arguments
intbKeyboard
Returns
int

 
 top of page
Method getContextMenuOffsetY
Signature
getContextMenuOffsetY(intbKeyboard)
 :int
Arguments
intbKeyboard
Returns
int

 
 top of page
Method getCursorIndex
Signature
getCursorIndex():int
Returns
int

 
 top of page
Method getDataSizeY
Return height of table data view (pixels).
Signature
getDataSizeY():int
Returns
int

 
 top of page
Method getFirstVisibleRowHeight
Signature
getFirstVisibleRowHeight():int
Returns
int

 
 top of page
Method getFirstVisibleRowNr
Signature
getFirstVisibleRowNr():int
Returns
int

 
 top of page
Method getLastVisibleRowHeight
Signature
getLastVisibleRowHeight():int
Returns
int

 
 top of page
Method getLastVisibleRowNr
Signature
getLastVisibleRowNr():int
Returns
int

 
 top of page
Method getLeadSelection
Signature
getLeadSelection():int
Returns
int

 
 top of page
Method getMaximumColumnWidth
Used to limit the column width to a sane value when the user resizes a column.
Signature
getMaximumColumnWidth(intcol)
 :int
Arguments
intcol
Returns
int

 
 top of page
Method getMinimumColumnWidth
Used to limit the column width to a sane value when the user resizes a column.
Signature
getMinimumColumnWidth(intcol)
 :int
Arguments
intcol
Returns
int

 
 top of page
Method getNumColumns
Return the number of columns
Signature
getNumColumns():int
Returns
int

 
 top of page
Method getNumRows
Return the number of data rows.
Signature
getNumRows():int
Returns
int

 
 top of page
Method getPreferredColumnWidth
Return the preferred colum width (relative pixels). When layouting the column header, the effective column width is calculated by adding all preferred column widths to get the 100% width and then using the preferred column width of a single column as a weight relative to the current table width.
Signature
getPreferredColumnWidth(intcol)
 :int
Arguments
intcol
Returns
int

 
 top of page
Method getRowHeight
Return the height (in pixels) of the given row. Used to calculate the cell position. _row must be a model space row number.
Signature
getRowHeight(introw)
 :int
Arguments
introw
Returns
int

 
 top of page
Method getRowPixelOffsetY
Signature
getRowPixelOffsetY(introw)
 :int
Arguments
introw
Returns
int

 
 top of page
Method getSortedRowNr
Map visible row number to model row number. If the row cannot be mapped, -1 is returned.
Signature
getSortedRowNr(intviewNr)
 :int
Arguments
intviewNr
Returns
int

 
 top of page
Method getTotalHeight
Return the height (in pixels) of all rows.
Signature
getTotalHeight():int
Returns
int

 
 top of page
Method getTotalWidth
Return the width (in pixels) of all columns.
Signature
getTotalWidth():int
Returns
int

 
 top of page
Method getUnsortedRowNr
Map model row number to visible row number.
Signature
getUnsortedRowNr(introwNr)
 :int
Arguments
introwNr
Returns
int

 
 top of page
Method getViewPixelOffsetY
Signature
getViewPixelOffsetY():int
Returns
int

 
 top of page
Method getVisibleRowNrAtY
Signature
getVisibleRowNrAtY(intpy)
 :int
Arguments
intpy
Returns
int

 
 top of page
Method handleCellEdited
Can be used to retrieve the final editor value (value changed)
Signature
handleCellEdited(ui::TableCellEditortce)
Arguments

 
 top of page
Method handleCellEditing
Can be used to retrieve the current editor value (value changing)
Signature
handleCellEditing(ui::TableCellEditortce)
Arguments

 
 top of page
Method handleCellOnMouse
Can be used to implement in-place cell editing.
Signature
handleCellOnMouse(intcol,
  introw,
  ui::MouseEventev 
  )  
 :int
Arguments
intcol
introw
ui::MouseEventev
Returns
int

 
 top of page
Method handleCursorIndexChanged
Signature
handleCursorIndexChanged()

 
 top of page
Method handleRowClick
May be overwritten by derived classes to internally handle row clicks.
Signature
handleRowClick(intbFoldHint)
 :int
Arguments
intbFoldHint
Returns
int

 
 top of page
Method hasDataViewKeyboardFocus
Signature
hasDataViewKeyboardFocus():int
Returns
int

 
 top of page
Method incVisibleCursorIndex
Signature
incVisibleCursorIndex()

 
 top of page
Method initTableModel
Signature
initTableModel()

 
 top of page
Method layoutColumns
Signature
layoutColumns(inttotalX)
Arguments
inttotalX

 
 top of page
Method selectNone
Deselect all rows
Signature
selectNone()

 
 top of page
Method setColumnWidth
Called when the user has resized a column.
Signature
setColumnWidth(intcol,
  intwidth 
  )  
Arguments
intcol
intwidth

 
 top of page
Method setCursorIndex
Signature
setCursorIndex(intindex)
Arguments
intindex

 
 top of page
Method setCursorIndexByPixel
Signature
setCursorIndexByPixel(floatpy)
Arguments
floatpy

 
 top of page
Method setCursorIndexToFirstRow
Signature
setCursorIndexToFirstRow()

 
 top of page
Method setCursorIndexToLastRow
Signature
setCursorIndexToLastRow()

 
 top of page
Method setLeadSelection
Signature
setLeadSelection(intleadIndex)
Arguments
intleadIndex

 
 top of page
Method setPrimarySortColumn
Signature
setPrimarySortColumn(intcol)
Arguments
intcol

 
 top of page
Method setSecondarySortColumn
Signature
setSecondarySortColumn(intcol)
Arguments
intcol

 
 top of page
Method setViewPixelOffsetY
Signature
setViewPixelOffsetY(inty)
Arguments
inty

 
 top of page
Method sortRows
Sort rows by primary/secondary columns. This method will use @compareCells to build the sorted_rows array.
Signature
sortRows()

 
 top of page
Method tableModelChanged
Signature
tableModelChanged()

 
 top of page
Method updateCellRendererLabelColor
Signature
updateCellRendererLabelColor(ui::Labellb,
  intcol,
  introw,
  intvisibleRow 
  )  
Arguments
ui::Labellb
intcol
introw
intvisibleRow

 
 top of page
Constant MINIMUM_ROW_HEIGHT (int)

 

Project Modules:MAbstractXMLForm , MAcceleratorKey , MAcceleratorList , MAction , MActionConsumer , MActionProvider , MBezierEdit , MButton , MCharFilter , MCharFilterFloat , MCharFilterFloatExpr , MCharFilterHex , MCharFilterHexExpr , MCheckBox , MChoiceDialog , MColorBox , MColorButton , MComboBox , MComboBoxTM , MComposite , MControl , MCursorShapes , MDial , MDialog , MDynamicPopupMenuAction , MFBO , MFloatAction , MFloatField , MFloatingLayer , MFloatParam , MFloatParamEditor , MFont , MFontResource , MForm , MFT2Face , MFT2FontCache , MFT2Glyph , MGeometry4f , MHiddenPanel , MHSVColorPicker , MIcon , MIconCache , MInfoDialog , MIntAction , MKeyAction , MLabel , MLayer , MLayerSwitch , MLayout , MLookAndFeel , MLookAndFeel_DarkFawn , MLookAndFeel_Gray , MLookAndFeel_LightFawn , MLookAndFeel_LightGray , MMouseEvent , MOpaquePanel , MPanel , MPNGIcon , MPoint2f , MPopupMenu , MPopupMenuBar , MPopupMenuBarButton , MPopupMenuButton , MPopupMenuCheckButton , MPopupMenuFolderButton , MPopupMenuSeparator , MPopupMenuWindowDock , MRadioButton , MRadioButtonGroup , MRectangle2f , MRepeatButton , MScroller , MScrollPane , MSize2f , MSizeGroup , MSizeGroupX , MSizeGroupXY , MSizeGroupY , MSlider , MSpacer , MSplitPane , MStatusBar , MStringAction , MStringDialog , MSuperBorderLayout , MTabbedView , MTableCellEditor , MTableCellEditorCheckBox , MTableCellEditorComboBox , MTableCellEditorFloatParam , MTableModel , MTableView , MTableViewData , MTableViewHeader , MTabSwitch , MTextEdit , MTextEditDialog , MTextField , MTextFieldIncDec , MTextInputDialog , MTextView , MTimerAction , MTitledPanel , MToolTip , MTransparentPanel , MTreeTableModel , MTreeTableNode , MUI , MUIConstants , MUIPluginLoader , MUIRenderer , MValueAction , MVector2f , MView , MViewPane , MWindow , MWindowDock , MWindowTitleBar , MXFMObject , MXMLForm 
Project Classes:ColorBox , HSVColorPicker , ui::AbstractXMLForm , ui::AcceleratorKey , ui::AcceleratorList , ui::Action , ui::ActionConsumer , ui::ActionProvider , ui::BezierEdit , ui::BezierEditState , ui::BezierHistory , ui::BorderLayout , ui::Button , ui::CharFilter , ui::CharFilterFloat , ui::CharFilterFloatExpr , ui::CharFilterHex , ui::CharFilterHexExpr , ui::CheckBox , ui::ChoiceDialog , ui::ColorButton , ui::ComboBox , ui::ComboBoxPopup , ui::ComboBoxTM , ui::Composite , ui::Control , ui::CursorShapes , ui::Dial , ui::Dialog , ui::DynamicPopupMenuAction , ui::FBO , ui::FloatAction , ui::FloatField , ui::FloatingLayer , ui::FloatParam , ui::FloatParamEditor , ui::Font , ui::FontResource , ui::Form , ui::FT2Face , ui::FT2FontCache , ui::FT2FontResource , ui::FT2Glyph , ui::FT2LocalFileFontResource , ui::FT2PakFileFontResource , ui::Geometry4f , ui::HiddenPanel , ui::Icon , ui::IconCache , ui::InfoDialog , ui::IntAction , ui::KeyAction , ui::KeyRepeatAction , ui::KeyRepeatConsumer , ui::Label , ui::Layer , ui::LayerSwitch , ui::Layout , ui::LookAndFeel , ui::LookAndFeel_DarkFawn , ui::LookAndFeel_Gray , ui::LookAndFeel_LightFawn , ui::LookAndFeel_LightGray , ui::MouseEvent , ui::MouseHoldAction , ui::MouseHoldConsumer , ui::OpaquePanel , ui::Panel , ui::PNGIcon , ui::Point2f , ui::PopupMenu , ui::PopupMenuBar , ui::PopupMenuBarButton , ui::PopupMenuButton , ui::PopupMenuCheckButton , ui::PopupMenuFolderButton , ui::PopupMenuRadioButton , ui::PopupMenuSeparator , ui::PopupMenuWindowDock , ui::RadioButton , ui::RadioButtonGroup , ui::Rectangle2f , ui::RepeatButton , ui::Scroller , ui::ScrollPane , ui::Size2f , ui::SizeGroup , ui::SizeGroupX , ui::SizeGroupXY , ui::SizeGroupY , ui::Slider , ui::Spacer , ui::SplitPane , ui::StatusBar , ui::StatusBarListener , ui::StatusBarMessage , ui::StringAction , ui::StringDialog , ui::StringDialogTextField , ui::SuperBorderLayout , ui::TabbedView , ui::TableCellEditor , ui::TableCellEditorCheckBox , ui::TableCellEditorComboBox , ui::TableCellEditorFloatParam , ui::TableModel , ui::TableView , ui::TableViewData , ui::TableViewHeader , ui::TabSwitch , ui::TabSwitchLabelPanel , ui::TextEdit , ui::TextEditDialog , ui::TextField , ui::TextFieldIncDec , ui::TextInputDialog , ui::TextView , ui::TimerAction , ui::TitledPanel , ui::ToolTip , ui::TransparentPanel , ui::TreeTableModel , ui::TreeTableNode , ui::TriadKeyConsumer , ui::UI , ui::UIConstants , ui::UIRenderer , ui::ValueAction , ui::Vector2f , ui::View , ui::ViewPane , ui::Window , ui::WindowDock , ui::WindowTitleBar , ui::XFMObject , ui::XMLForm 
Project Functions:getTableViewStepSizeDec , getTableViewStepSizeInc , Screen_onApplicationActive , Screen_onClose , Screen_onDraw , Screen_onDropFiles , Screen_onExpose , Screen_onInputFocusActive , Screen_onKeyboard , Screen_onMouse , Screen_onMouseFocusActive , Screen_onOpen , Screen_onResize , Screen_onTimer 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 14:27:06