Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
_DateChooser_Colors
_DateChooser_Data
_DateChooser_Date
_DocumentItem
_DocumentLayout
_FilePropertiesData
_IconPanelContainer
_TabPanelContainer
_ToolPanelContainer
_WizardContainer
Balloon
Bookmarks
ButtonBox
ColorButton
ColorChooser
ColorPalette
Completion
DateBox
DateChooser
DirBox
DirBrowser
DirChooser
DirView
DocumentView
Expander
FileBox
FileChooser
FileCompletion
FileProperties
FileView
FontBox
FontChooser
IconPanel
ImageView
InputBox
LCDLabel
ListContainer
ListEditor
MaskBox
MenuButton
Message
MessageView
SidePanel
SliderBox
SpinBar
Spinner
Stock
SwitchButton
TableView
_new
Cancel
Clear
Click
Edit
Editor
EditWith
Hide
Insert
NoKeyboard
Save
Save
TabPanel
TimeBox
ToolPanel
URLLabel
ValueBox
Wizard
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

TableView (gb.form)

This control is an editable GridView.

This class inherits GridView in gb.qt4.
This class is
Creates a new TableView control.
creatable
.
This class acts like a
Return a cell from its row and its column.
read-only
array.
Constants
Indicate that both horizontal and vertical headers must be displayed.
Both  
Indicate that the horizontal header must be displayed.
Horizontal  
Indicate that no header is displayed.
None  
Indicate that the vertical header must be displayed.
Vertical  
Properties Methods Events
Returns or sets the action string associated with the control.
Action  
Return or set if the last column will automatically be resized so that the gridview view area is entirely covered.
AutoResize  
Returns or sets the background color used by the control.
Background  
Return or set if the control displays a border.
Border  
Returns a collection of each control included in the container.
Children  
A synonymous for the ClientHeight property.
ClientH  
Return the height of the internal area containing the cells.
ClientHeight  
A synonymous for the ClientWidth property.
ClientW  
Return the width of the internal area containing the cells.
ClientWidth  
Return the left position of the internal area containing the cells.
ClientX  
Return the top position of the internal area containing the cells.
ClientY  
Return or set the index of the current column.
Column  
Return a virtual array of each gridview column.
Columns  
Return the current cell.
Current  
Use this property for assigning a custom cursor to a control.
Cursor  
Use this property to store the contents of a cell during the Data event handler.
Data  
Indicates that the control is in design mode.
Design  
Return or set the control text direction.
Direction  
Returns or sets if a control accepts drops.
Drop  
Returns the control used for editing the cell.
Editor  
Indicates that the control is enabled.
Enabled  
Returns or sets if a control will expand if included in a container that arranges its contents.
Expand  
Returns or sets the font used to draw text in the control.
Font  
Returns or sets the foreground color used by the control.
Foreground  
Return or set if the grid is displayed.
Grid  
A synonymous for the Height property.
H  
Returns the internal X11 window handle of the control.
Handle  
Returns whether the control has the focus.
HasFocus  
Return or set which headers should be displayed:
Header  
Returns or sets the height of the control.
Height  
Returns whether the mouse cursor is inside the control.
Hovered  
A synonymous for the Handle property.
Id  
Returns or sets if a control must be ignored when its parent arranges its children.
Ignore  
Returns or sets the position of the left border of the control relative to its parent.
Left  
Return or set the selection mode:
Mode  
Returns or sets the appearence of the cursor when it points inside the control.
Mouse  
Returns or sets the name of the control.
Name  
Returns the next control having the same parent.
Next  
Returns or sets if the arrow keys will move the current cell.
NoKeyboard  
Return or set if a control cannot be focused with the TAB key.
NoTabFocus  
Return or set the default cell padding in pixels.
Padding  
Returns the control container.
Parent  
Return or set the name of the menu that will be popped-up when the user presses the right mouse button or the keyboard MENU key.
PopupMenu  
Returns the previous control having the same parent.
Previous  
Return or set the "proxy" of a control.
Proxy  
Return or set if the column headers are resizable.
Resizable  
Return if the control is right to left oriented.
RightToLeft  
Return or set the index of the current row.
Row  
Return a virtual array of each gridview row.
Rows  
Returns the position of the left border of the control in screen coordinates.
ScreenX  
Returns the position of the top border of the control in screen coordinates.
ScreenY  
Return or set which scrollbars are displayed.
ScrollBar  
A synonymous for ScrollHeight.
ScrollH  
Returns the contents height.
ScrollHeight  
A synonymous for ScrollWidth.
ScrollW  
Returns the contents width.
ScrollWidth  
Returns or sets the horizontal scrolling position.
ScrollX  
Returns or sets the vertical scrolling position.
ScrollY  
Return or set if a light cursor is drawn around the current cell.
ShowCursor  
Return or set if clicking on a column header toggles the sort indicator.
Sorted  
Returns or sets the control tag.
Tag  
Returns or sets the tooltip shown when the mouse stays on the control for a short time.
Tooltip  
Returns or sets the position of the top border of the control relative to its parent.
Top  
Returns or sets if the control will receive MouseMove events.
Tracking  
Indicates if the control is visible or not.
Visible  
A synonymous for the Width property.
W  
Returns or sets the width of the control.
Width  
Returns the top-level window that contains the control.
Window  
Returns or sets the position of the left border of the control relative to its parent.
X  
Returns or sets the position of the top border of the control relative to its parent.
Y  
Add a new column to the GridView.
AddColumn  
Cancels the current edition.
Cancel  
Clear the grid static contents.
Clear  
Return the index of the column pointed by the specified horizontal position.
ColumnAt  
Destroys the control.
Delete  
Starts a drag & drop process.
Drag  
Starts editing the current cell.
Edit  
Edit the current cell with a specific control.
EditWith  
Finds the first child control pointed by the X and Y coordinates.
FindChild  
Grab the keyboard and the mouse so that all keyboard and mouse events are received by the control.
Grab  
Hides the control.
Hide  
Sends the control to the background of its parent.
Lower  
Moves and/or resizes the control.
Move  
Moves and/or resizes the control.
MoveScaled  
Set the current cell row and column.
MoveTo  
Sends the control to the foreground of its parent.
Raise  
Trigger a redraw of the control.
Refresh  
Changes the container of a control.
Reparent  
Resizes the control.
Resize  
Resizes the control.
ResizeScaled  
Return the index of the row pointed by the specified vertical position.
RowAt  
Save the current edit and update the edited TableView item.
Save  
Scroll the contents to the given position.
Scroll  
Selects several rows.
Select  
Select all rows.
SelectAll  
Gives the focus to the control.
SetFocus  
Shows the control.
Show  
Unselect all rows.
UnSelectAll  
Raised when the user double-clicks on a cell.
Activate  
This event is raised when a container has just finished arranging its contents.
Arrange  
This event is raised just before a container arranges its contents.
BeforeArrange  
Raised when the current cell has changed.
Change  
This event is raised when the user has clicked on a cell.
Click  
Raised when the user clicks on a column header.
ColumnClick  
Raised when a column is resized.
ColumnResize  
Raised when a specific column has been resized by the user with a double-click on the border separating it from the next column.
ColumnSize  
This event is raised when the data stored in the specified cell is needed (usually to draw it).
Data  
Raised when the user quickly clicks twice on the control.
DblClick  
This event is raised when the mouse enters the control during a drag & drop process.
Drag  
This event is raised when the mouse leaves the control during a drag & drop operation.
DragLeave  
This event is raised while the mouse moves inside the control during a drag & drop process.
DragMove  
Raised when a cell must be drawn.
Draw  
This event is raised when a drag is dropped in the control.
Drop  
Raised when the mouse enters the control.
Enter  
This event is raised when the control font changes.
Font  
Raised when the control has got the focus.
GotFocus  
This event is raised just after the TableView editor is hidden.
Hide  
This event is raised when the user requested an insertion by hitting the RETURN key inside the bottom-right cell.
Insert  
Raised when a key is pressed while the control has the focus.
KeyPress  
Raised when a key is released while the control has the focus.
KeyRelease  
Raised when the mouse leaves the control.
Leave  
Raised when the control has lost the focus.
LostFocus  
Raised when the user clicks on the control with the right mouse button, or if it hits the MENU key.
Menu  
Raised when a mouse button is pressed while the cursor is inside the control.
MouseDown  
This event is raised when a drag operation should be started.
MouseDrag  
Raised when the mouse moves inside the control while a mouse button is pressed.
MouseMove  
Raised when a mouse button is depressed while the cursor is inside the control.
MouseUp  
This event is raised when the user moves or presses the mouse wheel while the mouse is inside the control.
MouseWheel  
This event is raised when a new child Control has just been inserted into the container.
NewChild  
Raised when the user clicks on a row header.
RowClick  
Raised when a row is resized.
RowResize  
Raised when a specific row has been resized.
RowSize  
This event is raised when some value must be saved in a specified cell.
Save  
Raised when the control contents have been scrolled.
Scroll  
Raised when the selection changes.
Select  
Raised when the GridView contents must be sorted.
Sort  

How to make a cell editable

To make a cell editable, you must call the Edit or EditWith method in response to a Click or Activate event.

Calling one of this method creates a cell editor widget that allows the user to modify the cell contents. This editor is automatically managed by the TableView.

If the user modifies the cell contents, then the Save event is raised, and you must actually save the data during the Save event handler. This is not automatic!

If you want to explicitly cancel an edition, call the Cancel method.

Keyboard management

Hitting an arrow key while editing a cell automatically moves the cell editor to the nearest editable cell.

To know if a cell is editable or not, the Click or Activate event is raised, and if no Edit or EditWith method is called in response to the event, the move is repeated until a TableView border is reached.

Hitting the ESC key cancels the current edition.

Hitting the ENTER or the RETURN key moves to the next cell like the right arrow key. But if the end of the TableView is reached, the Insert event is raised.

Beware that the Edit or EditWith method must be called during the Click or Activate event handler, otherwise the keyboard management won't work!