-
Common to lists
All GUI lists, tables, trees and selectlists do have a common base for setting up and reading data. This is a list of all common settings. This comes as addition to the all the common guiobject settings that also are supported.
'supportrefresh' Tells the element if it should store away the load data function, so we can use the refresh method. Default is False. 'editmode' Tells if the items in the elements should have edit capabilities. Default in None. Supported settings are None, Changed, Activated, Selected, EditKey, AnyKey and All. This sets the edit trigger to be used. 'activated' An action to run if item activated. The item is usually activated by double clicking or pressing enter, but other settings might tell otherways. 'selected' An action to be run if item is selected. This can both be by keyboard or by mouse click. 'mouserelease' An action to be run if mouse key is released. 'focusin' Action called when element getting focus. 'focusout' Action called when element losing focus. 'heading' Horizontal heading to be set in one of the valid formats. 'vheading' Vertical headings to be set in on of the valid formats. 'elements' The data for the element in one of the valid formats. 'columndef' Definitions to style the headings. Alignments etc. 'resizecolumnstocontents' Tell columns to resize to the data content horizontally. 'resizerowstocontents' Tell row to resize to the data content vertically. 'stretchlast' Resize to last column to take rest of the screen. Needs to have a horizontal header to work. 'itemclicked' Action to run when item is clicked. 'editorforcolumn' The field definition to be used for the columns edit when editmode is set to something else than None. If nothing set, selected clicked is used as default. Se own section about the format to use in the dict for the settings. 'contextmenu' The context menu to use as default for the parent element. Each item can have their own as well. Se own section about item definition. The elements that inherit all these settings are: list, table, tree, directorytree and togglelist.
Item element format
The items can be defined several ways. The are the different formats supported. What formats that can be used depends on the type of structure to be represented. The supported types of elements are list, tree and table. Each of these have their own data format before you get to the items, but the items usually supports the same settings for all. The horizontal and vertical headings supports many of the same settings as the items. Here are the basic structures fore the different types, followed by the general item format supported by all. Details for each type can be found in the description of each type.
ListsThe list format is basically an array of elements.
Tree
The tree is either an array of strings in folder format "/rootelement/subelement1/subelement2/leaf", an array of dictionaries or a dictionary structure.
Table
This is usually an array of arrays of some sort, but each element in the second array can be a string for basic values or a item definition dict.
Common item definition
'contextmenu' Context menu for the item. 'params' You can use this to store custom parameters than can be used by you later. 'expand' Should item be expanded or collapsed. Usually only in use in trees. 'clicked' Action to call when item is clicked. 'dblclicked' Action to call when item is double clicked. 'selected' Action to call when item is selected. 'activated' Action to call when item is activated. 'size' A tuple with the size of the cell. Ex. (120,120). 'width' Set to column width. 'align' Alignment of the text in the item box. More than one can be separated by a /. Supported values are 'left', 'right', 'center', 'hcenter', 'justify', 'top', 'bottom' and 'vcenter'. 'backgroundcolor' Set the background color of the cell. 'color' Set the text color of the item. 'font' Set the font to use on the item.
Editor element formatWhen edit mode is set to be used, you can add almost any valid guiobject as an editor. This is the format to use.
'type' The element type to be used. This will give the editor the element to load. All settings supported by the element will then be available for use. 'column' The column number to add the editor to. Index is 0 based. 'readaction' The action to be called after the data is exchanged with the editor item but before the editor given to the user. 'writeaction' The action to be called after the data is exchanged with the item. 'datatype' The datatype used to set the model data. You set this for each column to support an editor. The one not set will get a line edit as default.