|
List view widget. More...
#include <CListView.h>
Public Member Functions | |
| CListView (const char *label=nullptr, int layoutSize=20, CLayoutAlign layoutAlign=CLayoutAlign::TOP) | |
| Constructor in SPTK style. More... | |
| ~CListView () override | |
| Destructor. | |
| int | handle (int) override |
| Overwritten handle() | |
| void | resize (int x, int y, int w, int h) override |
| Resizes the control and inside widgets. More... | |
| virtual void | removeRow (uint32_t index) |
| Removes row. More... | |
| virtual void | addRow (CPackedStrings *row) |
| Adds new row. More... | |
| virtual void | addRow (int ident, const Strings &row) |
| Adds new row. More... | |
| virtual void | insertRow (uint32_t position, const Strings &row, int ident) |
| Inserts new row. More... | |
| virtual void | updateRow (uint32_t position, CPackedStrings *row) |
| Updates a row. More... | |
| virtual void | updateRow (uint32_t position, const Strings &row, int ident=0) |
| Updates a row. Optional row argument may be defined inside row parameter. More... | |
| virtual void | clear () |
| Removes all the rows. | |
| virtual uint32_t | size () const |
| Returns the row count. | |
| virtual int | top () const |
| Returns the scroll position. | |
| virtual void | top (int index) |
| Sets the scroll position. More... | |
| int | selected (int index) const |
| void | show (int index) |
| void | show () override |
| void | hide (int index) |
| void | hide () override |
| int | visible (int index) const |
| int | visible () const |
| std::string | textValue () const |
| void | textValue (const std::string &text) |
| void | dataMode (CListViewDataMode dm) |
| CListViewDataMode | dataMode () const |
| Variant | data () const override |
| void | data (const Variant &v) override |
| CPackedStrings * | row (uint32_t index) const |
| const CSelection & | selection () const |
| CPackedStrings * | selectedRow () const |
| int | selectedIndex () const |
| bool | selectRow (uint32_t index, bool sel=true) |
| bool | displayed (uint32_t index) const |
| virtual void | displayRow (uint32_t index) |
| void | redrawRow (uint32_t index) |
| void | columns (const CColumnList &columns) |
| Sets a new column list. More... | |
| CColumnList & | columns () |
| Returns column list. | |
| CColumn & | column (uint32_t col) |
| Returns column informartion. More... | |
| CColumn & | column (const char *colname) |
| Returns column informartion. More... | |
| void | addColumn (const CColumn &column) |
| Adds a new column as a copy of column. More... | |
| void | addColumn (const String &colname, VariantDataType type, uint32_t cwidth=100, bool cvisible=true) |
| Adds a new column as a copy of column. More... | |
| CControlKind | kind () const override |
| SPTK RTTI information. More... | |
| bool | autoRowHeight () const |
| Returns auto row height mode as true/false. | |
| void | autoRowHeight (bool arh) |
| Sets auto row height mode as true/false. | |
| Fl_Font | textFont () const override |
| Returns text font type. More... | |
| void | textFont (Fl_Font f) override |
| Sets text font type. More... | |
| uchar | textSize () const override |
| void | textSize (uchar s) override |
| Sets text font size. More... | |
| Fl_Color | textColor () const override |
| Returns text color. More... | |
| void | textColor (Fl_Color n) override |
| Sets text color. More... | |
| bool | showGrid () const |
| Returns show grid mode. | |
| void | showGrid (bool flag) |
| Sets show grid mode. | |
| bool | showStripes () const |
| Returns show stripes. | |
| void | showStripes (bool flag) |
| Sets show stripes mode. | |
| bool | showSelection () const |
| Returns show selection mode. | |
| void | showSelection (bool flag) |
| Sets show selection mode. | |
| bool | multiSelect () const |
| Returns multiple selection enabled or disabled. | |
| void | multiSelect (bool ms) |
| Sets multiple selection enabled or disabled. | |
| void | getSelections (std::vector< uint64_t > &selection) const |
| Returns a selected rows ID list. | |
| void | setSelections (const std::vector< uint64_t > &selection) |
| Sets a selected rows ID list. | |
| CPackedStrings * | findCaption (const String &caption) |
| Finds an item with the caption (a string in the first column). More... | |
| CPackedStrings * | findKey (int keyValue) |
| Finds an item with the key (an integer associated with the item - argument()). More... | |
| uint32_t | fullWidth () const |
| Returns maximum width of all items including the header row. | |
| uint32_t | fullHeight () const |
| Returns summary height of all items including the header row. | |
| virtual int | findString (const std::string &str, bool select=true, uint32_t startRow=0, uint32_t endRow=0) |
| Finds a string in the sort column of list view defined with sortColumn() More... | |
| String | sortColumnName () const |
| Returns sort column name. | |
| void | sortColumn (int column, bool sortNow) |
| Sets the sort column. More... | |
| int | sortColumn () const |
| Returns the sort column number. | |
| bool | sortAscending () const |
| Returns the sort direction - ascending/descending. | |
| void | sortAscending (bool ascending, bool sortNow) |
| Sets the sort direction - ascending/descending. More... | |
| void | sort () |
| Sorts ListView rows using existing information about sort column and direction. | |
| void | fill (DataSource &ds, const String &keyFieldName="", uint32_t recordsLimit=0, uint32_t recordsEstimated=0, CRefreshKind refreshKind=CRefreshKind::LV_REFRESH_FULL) |
| Fills the list view with the data from datasource. More... | |
| void | loadList (const xdoc::SNode &node) |
| Fills the list with the data from XML node. More... | |
| void | saveList (const xdoc::SNode &node) const |
| Saves the list data into XML node. More... | |
| bool | preferredSize (int &w, int &h) override |
| Computes the optimal widgets size. More... | |
| uint32_t | headerHeight () const |
| Returns header height. | |
| void | headerHeight (uint32_t hh) |
| Sets the header height, 0 to hide headers. | |
| uint32_t | activeRow () const |
| Returns the currently active row. | |
| bool | capitalizeColumnNames () const |
| Returns true if column names are auto-capitilized. | |
| void | capitalizeColumnNames (bool ccn) |
| Defines if column names should be auto-capitilized. More... | |
| void | terminateFill () |
| Terminate the current fill() operation (if in progress) | |
| String | className () const override |
| Returns widget class name (internal SPTK RTTI). More... | |
| void | imageCollection (Strings &iconNames) |
| Sets the images that may be referred from items. More... | |
Public Member Functions inherited from sptk::CControl | |
| CControl (const char *label, int layoutSize=20, CLayoutAlign layoutAlign=CLayoutAlign::TOP) | |
| Constructor in SPTK style. More... | |
| void | resize (int x, int y, int w, int h) override |
| Resizes the control and inside widgets. More... | |
| void | draw () override |
| Draws the control. | |
| virtual int | tag () const |
| Returns the control's user data tag. | |
| virtual void | tag (int t) |
| Sets the control's user data tag. | |
| virtual Fl_Font | textFont () const |
| Returns the control's text font. More... | |
| virtual void | textFont (Fl_Font) |
| Sets the control's text font. More... | |
| virtual uchar | textSize () const |
| Returns the control's text font size. More... | |
| virtual void | textSize (uchar) |
| Sets the control's text font size. More... | |
| virtual Fl_Color | textColor () const |
| Returns the control's text color. More... | |
| virtual void | textColor (Fl_Color) |
| Sets the control's text color. More... | |
| virtual Fl_Color | labelColor () const |
| Returns the control's label color. | |
| virtual void | labelColor (Fl_Color) |
| Sets the control's label color. | |
| virtual Fl_Color | color () const |
| Returns the control's background color. | |
| virtual void | color (Fl_Color) |
| Sets the control's background color. | |
| uint32_t | flags () const |
| Returns the control's flags. | |
| void | flags (uint32_t flags) |
| Sets the control's flags. | |
| Fl_Widget * | control () const |
| Returns main widget inside the container. | |
| const String & | label () const override |
| Returns control's label. More... | |
| void | label (const String &) override |
| Sets control's label. More... | |
| Fl_Menu_ * | menu () const |
| Returns control's menu. | |
| void | menu (const Fl_Menu_Item *) |
| Sets control's menu. | |
| Fl_Font | labelFont () const |
| Returns control's label font. | |
| void | labelSize (Fl_Font f) |
| Sets control's label font. | |
| uchar | labelSize () const |
| Returns control's label font size. | |
| void | labelSize (uchar) |
| Sets control's label font size. | |
| uint32_t | labelWidth () const |
| Returns control's label width. | |
| void | labelWidth (uint32_t) |
| Sets control's label width. | |
| void | hint (const String &str) |
| Sets control's hint (tooltip) More... | |
| String | hint () const |
| Returns control's hint (tooltip) | |
| virtual int | maxLength () const |
| Returns control's max input length, if applicable. More... | |
| virtual void | maxLength (int) |
| Sets control's max input length, if applicable. More... | |
| virtual const String & | fieldName () const |
| Returns control's field name for universal data connection. | |
| virtual void | fieldName (const String &) |
| Sets control's field name for universal data connection. | |
| virtual CControlKind | kind () const =0 |
| Returns control's kind (internal SPTK RTTI). More... | |
| String | className () const override |
| Returns control's class name (internal SPTK RTTI). More... | |
| virtual void | reset () |
| Sets the control to empty text (for the input entries) More... | |
| virtual void | load (Query *) |
| Loads control data from query fields. More... | |
| virtual void | save (Query *) |
| Saves control data to query params. More... | |
| void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) override |
| Loads control data from XML. More... | |
| void | load (const xdoc::SNode &node) override |
| Loads control data from XML. More... | |
| void | save (const xdoc::SNode &node, CLayoutXMLmode xmlMode) const override |
| Saves control data to XML. More... | |
| virtual void | save (const xdoc::SNode &node) const |
| Saves control data to XML. More... | |
| virtual bool | valid () const =0 |
| Returns true if the control state is valid, and the data is inside the limits (if applicable) More... | |
| virtual Variant | data () const |
| The universal data connector. More... | |
| virtual void | data (const Variant &v) |
| The universal data connector, sets control data. More... | |
| void | fireEvent (CEvent ev, int32_t arg) |
| Fires the event generated by this control. | |
| const CEventInfo & | event () const |
| Returns the last event fired by this control. | |
| CEvent | eventType () const |
| Returns the event type for the last fired by this control. | |
| int | eventArgument () const |
| Returns the event argument for the last fired by this control. | |
| CControl & | operator= (const String &str) |
| Control data assignment. | |
| CControl & | operator= (const char *str) |
| Control data assignment. | |
| CControl & | operator= (int32_t v) |
| Control data assignment. | |
| CControl & | operator= (uint32_t v) |
| Control data assignment. | |
| CControl & | operator= (int64_t v) |
| Control data assignment. | |
| CControl & | operator= (float v) |
| Control data assignment. | |
| CControl & | operator= (double v) |
| Control data assignment. | |
| CControl & | operator= (const DateTime &dt) |
| Control data assignment. | |
| CControl & | operator= (const Field &fld) |
| Control data assignment. | |
| operator String () const | |
| Control data conversion. | |
| operator int32_t () const | |
| Control data conversion. | |
| operator uint32_t () const | |
| Control data conversion. | |
| operator int64_t () const | |
| Control data conversion. | |
| operator uint64_t () const | |
| Control data conversion. | |
| operator float () const | |
| Control data conversion. | |
| operator double () const | |
| Control data conversion. | |
| operator DateTime () const | |
| Control data conversion. | |
Public Member Functions inherited from sptk::CLayoutClient | |
| CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca) | |
| virtual | ~CLayoutClient () |
| CLayoutAlign | layoutAlign () const |
| void | layoutAlign (CLayoutAlign al) |
| int | layoutSize () const |
| void | layoutSize (int ls) |
| virtual void | label (const String &l) |
| virtual const String & | label () const |
| void | name (const char *aname) |
| void | name (const String &aname) |
| const String & | name () const |
| virtual bool | preferredSize (int &w, int &h) |
| virtual bool | computeSize (int &w, int &h) |
| virtual String | className () const |
| Fl_Widget * | widget () const |
| virtual void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) |
| virtual void | load (const std::shared_ptr< xdoc::Node > &node) |
| virtual void | save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const |
Protected Member Functions | |
| int | columnAt (int x) |
| Computes which column contains x-coordinate. More... | |
| int | find_item (int y) |
| Finds an item in vertical position y. More... | |
| void | bbox (int &X, int &Y, int &W, int &H) const |
| Returns the actual size of the drawing area (internal) More... | |
| int | hposition () const |
| Returns horizontal position of the scroll. | |
| void | hposition (int hpos) |
| Sets horizontal position of the scroll. More... | |
| int | find_id (int id) const |
| Finds item with ID. More... | |
| virtual int | get_focus () |
| Get focus callback (internal) | |
| virtual bool | item_selected (uint32_t index) const |
| Returns true if item is selected. More... | |
| virtual void | item_select (uint32_t index, bool select) |
| Selects or deselects the item. More... | |
| virtual int | item_compute_height_all () |
| Recomputes all items height. | |
| virtual int | item_compute_height (CPackedStrings *rowData) |
| Recomputes items height. More... | |
| virtual int | item_height (uint32_t index) const |
| Recomputes items height. More... | |
| virtual int | item_width (uint32_t index) const |
| Returns item width. More... | |
| virtual void | item_draw (uint32_t index, const CPackedStrings *rowData, int x, int y, int w, int h, int focusMode, int verticalAlign, bool paintBackground) const |
| Draws a row in coordinates (internal) More... | |
| virtual void | item_clicked (int mouse_btn) |
| virtual Fl_Color | item_color (int column, const CPackedStrings &rowData) const |
| The function that allows to overwrite the default text color for the cell. More... | |
| virtual void | header_draw (int x, int y, int hh) const |
| Draws header (internal) More... | |
| virtual void | header_clicked (int x) |
| Header clicked mouse callback. More... | |
| virtual bool | header_drag_position (int x) |
| Returns true if x is the drag-sensitive area. | |
| virtual void | header_dragged (int x) |
| Header dragged to position x notification. More... | |
| virtual void | header_released (int x) |
| Header released in position x notification. More... | |
| void | redraw_line (uint32_t index) |
| Request to redraw line index. More... | |
| void | redraw_lines () |
| Redraw all the lines. | |
| void | draw () override |
| General draw function. Draws everything. | |
| void | key_changed (uint32_t index) |
| Internal callback if selected another item with the different user _data (key). | |
| void | load (Query *) override |
| Loads the key value from the query. More... | |
| void | save (Query *) override |
| Saves the key value from the query. More... | |
| void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) override |
| Loads control data from XML. More... | |
| void | save (const xdoc::SNode &node, CLayoutXMLmode xmlMode) const override |
| Saves control data to XML. More... | |
| bool | valid () const override |
| True if the data is valid. More... | |
| virtual uint32_t | cellBorderWidth () const |
| Returns the cell border width. | |
| bool | select (uint32_t index, bool sel=true, int docallbacks=false) |
| Selects the row. Internal. More... | |
| bool | select_only (uint32_t index, bool docallbacks=false) |
| Selects the only row. Internal. More... | |
| bool | activate_row (uint32_t index) |
| Selects the row. Executes the callbacks. Internal. More... | |
| bool | select_first () |
| Selects the first row. Executes the callbacks. Internal. More... | |
| bool | select_last () |
| Selects the last row. Executes the callbacks. Internal. More... | |
| bool | select_next () |
| Selects the next row. Executes the callbacks. Internal. More... | |
| bool | select_prior () |
| Selects the prior row. Executes the callbacks. Internal. More... | |
| bool | select_next_page () |
| Selects the next page row. Executes the callbacks. Internal. More... | |
| bool | select_prior_page () |
| Selects the prior page row. Executes the callbacks. Internal. More... | |
Protected Member Functions inherited from sptk::CControl | |
| bool | containsFocus () const |
| Does the control contain focus? | |
| void | notifyFocus (bool gotFocus=true) |
| Internal focus notification on focus change. | |
| virtual void | onEnter () |
| Internal focus notification on focus change. | |
| virtual void | onExit () |
| Internal focus notification on focus change. More... | |
| uint32_t | labelHeight () const |
| Computes the label height based on the labelFont() and labelWidth() | |
| int | handle (int) override |
| Special handle() method. | |
Protected Member Functions inherited from sptk::CLayoutClient | |
| int | lastPreferredH () const |
| int | lastPreferredW () const |
| void | lastPreferredH (int height) |
| void | lastPreferredW (int width) |
Static Protected Member Functions | |
| static void | scrollbar_callback (Fl_Widget *s, void *) |
| Internal vertical scrollback callback. | |
| static void | hscrollbar_callback (Fl_Widget *s, void *) |
| Internal horizontal scrollback callback. | |
| static void | scrollbar_width (int b) |
| Changes the default scrollbar width for the class. More... | |
| static int | scrollbar_width () |
| Returns the default scrollbar width for the class. | |
Static Protected Member Functions inherited from sptk::CControl | |
| static void | internalCallback (Fl_Widget *internalWidget, void *data) |
| Internal callback function. | |
Protected Attributes | |
| bool | m_capitalizeColumnNames {false} |
| bool | m_multipleSelection {false} |
| int | m_horizPosition {0} |
| int | m_realHorizPosition {0} |
| int | m_maxWidth {0} |
| int | m_redraw1 {0} |
| int | m_redraw2 {0} |
| uint32_t | m_top {0} |
| int | m_currentTextFont {0} |
| int | m_currentTextSize {0} |
| Strings | m_iconNames |
| CListViewDataMode | m_dataMode {CListViewDataMode::LV_DATA_UNDEFINED} |
| Data mode Defines the kind of data to work through data() method. More... | |
| int | m_mousePressedX {0} |
| CSelection | m_selection |
| std::string | m_searchPhrase |
| uint32_t | m_activeRow {0} |
| uint32_t | m_headerHeight {0} |
| CListViewRows | m_rows |
| CColumnList | m_columnList |
| int | m_draggingColumn {0} |
| int | m_draggingStarted {0} |
| Fl_Font | m_textFont {0} |
| uchar | m_textSize {0} |
| Fl_Color | m_textColor {0} |
| bool | m_showStripes {false} |
| bool | m_showGrid {false} |
| bool | m_showSelection {false} |
| bool | m_autoRowHeight {false} |
| CScrollBar | scrollbar {0, 0, 0, 0} |
| Vertical scrollback. | |
| CScrollBar | hscrollbar {0, 0, 0, 0} |
| Horizontal scrollbar. | |
Protected Attributes inherited from sptk::CControl | |
| bool | m_limited {false} |
| uint32_t | m_labelWidth {0} |
| Fl_Color | m_labelColor |
| Fl_Color | m_textColor |
| Fl_Font | m_textFont |
| uchar | m_textSize {0} |
| String | m_fieldName |
| String | m_hint |
| Fl_Widget * | m_control {nullptr} |
| int | m_tag {0} |
| uint32_t | m_controlFlags {0} |
| Control's special flags (a bit combination of InputEntryFlags). More... | |
| Fl_Menu_Button * | m_menuButton {nullptr} |
| CEventInfo | m_event |
| bool | m_hasFocus {false} |
Protected Attributes inherited from sptk::CLayoutClient | |
| Fl_Widget * | m_widget |
| String | m_name |
| String | m_label |
| CLayoutAlign | m_layoutAlign |
Static Protected Attributes | |
| static int | m_scrollbarWidth |
Friends | |
| class | CInternalComboBoxPanel |
| class | CDBDropDownList |
Additional Inherited Members | |
Static Public Member Functions inherited from sptk::CControl | |
| static CControlKind | controlNameToType (const String &typeName, int &maxLength, const String &values="") |
| Converts control name to control kind. | |
| static void | defaultControlMenuCopy (Fl_Widget *, void *) |
| Default callback function to support CControl default menu item 'Copy'. | |
| static void | defaultControlMenuCut (Fl_Widget *, void *) |
| Default callback function to support CControl default menu item 'Delete'. | |
| static void | defaultControlMenuPaste (Fl_Widget *, void *) |
| Default callback function to support CControl default menu item 'Paste'. | |
| static void | defaultControlMenuClear (Fl_Widget *, void *) |
| Default callback function to support CControl default menu item 'Clear'. | |
Static Public Attributes inherited from sptk::CControl | |
| static const Fl_Menu_Item | defaultControlMenu [] |
| CControl default menu. | |
List view widget.
Class CListView is the list of multicolumn rows. It allows to sort rows by column, supports type-in incremental search etc.
| sptk::CListView::CListView | ( | const char * | label = nullptr, |
| int | layoutSize = 20, |
||
| CLayoutAlign | layoutAlign = CLayoutAlign::TOP |
||
| ) |
Constructor in SPTK style.
| label | const char *, label |
| layoutSize | int, widget align in layout |
| layoutAlign | CLayoutAlign, widget align in layout |
|
protected |
Selects the row. Executes the callbacks. Internal.
| index | int, row number |
|
inline |
Adds a new column as a copy of column.
| column | const CColumn&, new column information |
|
inline |
Adds a new column as a copy of column.
| colname | const char *, column name |
| type | VariantType, column data type |
| cwidth | uint32_t, column width |
| cvisible | bool, is the column visible? |
|
virtual |
Adds new row.
Optional row ID may be defined inside row parameter.
| row | Row data |
|
virtual |
Adds new row.
Optional row ID may be defined inside row parameter, or through ident parameter.
| ident | int, row argument (key value) |
| row | const Strings&, row data |
|
protected |
Returns the actual size of the drawing area (internal)
| X | int, output, x-xoordinate |
| Y | int, output, y-xoordinate |
| W | int, output, width |
| H | int, output, height |
|
inline |
Defines if column names should be auto-capitilized.
| ccn | bool, true if column names should be auto-capitilized |
|
inlineoverridevirtual |
Returns widget class name (internal SPTK RTTI).
Reimplemented from sptk::CControl.
| CColumn & sptk::CListView::column | ( | const char * | colname | ) |
Returns column informartion.
| colname | const char *, column name |
|
inline |
Returns column informartion.
| col | uint32_t, column number 0..columnCount() -1 |
|
protected |
Computes which column contains x-coordinate.
| x | int, coordinate |
| void sptk::CListView::columns | ( | const CColumnList & | columns | ) |
Sets a new column list.
| columns | const CColumnList&, new column list |
|
overridevirtual |
|
overridevirtual |
The universal data connector, selects row with user data
| v | const CVariant, user data value to find and select |
Reimplemented from sptk::CControl.
|
inline |
Returns data mode as LV_DATA_KEY, LV_DATA_INDEX, LV_DATA_CAPTION. Defines which information list view is working with in data() method - key value, item index, or item caption.
|
inline |
Sets data mode for the data() methods as LV_DATA_KEY, LV_DATA_INDEX, LV_DATA_CAPTION. Defines which information list view is working with in data() method - key value, item index, or item caption.
Referenced by sptk::CBaseListBox::dataMode().
| bool sptk::CListView::displayed | ( | uint32_t | index | ) | const |
Returns true if the row is currently visible in the scroll area
| index | int, row number |
|
virtual |
Makes the row visible in the scroll area
| index | int, row number |
| void sptk::CListView::fill | ( | DataSource & | ds, |
| const String & | keyFieldName = "", |
||
| uint32_t | recordsLimit = 0, |
||
| uint32_t | recordsEstimated = 0, |
||
| CRefreshKind | refreshKind = CRefreshKind::LV_REFRESH_FULL |
||
| ) |
Fills the list view with the data from datasource.
Uses all available datasource information about column and data types.
| ds | CDataSource&, the datasource |
| keyFieldName | std::string, field used to fill in key values |
| recordsLimit | uint32_t, maximum records to retrieve |
| recordsEstimated | uint32_t, records estimated (to use the fill progression event) |
| refreshKind | CRefreshKind, type of refresh - full or just changed records |
|
protected |
Finds item with ID.
| id | int, item id |
|
protected |
Finds an item in vertical position y.
| y | int, vertical position |
| CPackedStrings * sptk::CListView::findCaption | ( | const String & | caption | ) |
Finds an item with the caption (a string in the first column).
| caption | std::string, the caption to find and select. |
Referenced by sptk::CBaseListBox::findCaption().
| CPackedStrings * sptk::CListView::findKey | ( | int | keyValue | ) |
Finds an item with the key (an integer associated with the item - argument()).
| keyValue | int, the caption to find and select. |
Referenced by sptk::CBaseListBox::findKey().
|
virtual |
Finds a string in the sort column of list view defined with sortColumn()
| str | std::string, string to find |
| select | bool, true if we want to select the found row |
| startRow | uint32_t, the row number to start |
| endRow | uint32_t, the row number to finish |
|
protectedvirtual |
Header clicked mouse callback.
| x | int, x-coordinate |
|
protectedvirtual |
Header dragged to position x notification.
| x | int, x-coordinate |
|
protectedvirtual |
Draws header (internal)
| x | int, x-coordinate |
| y | int, y-coordinate |
| hh | int, header height |
|
protectedvirtual |
Header released in position x notification.
| x | int, x-coordinate |
|
inlineoverride |
Hides the list view widget
| void sptk::CListView::hide | ( | int | index | ) |
Switch the visibility flag for the row index
| index | int, row number |
|
protected |
Sets horizontal position of the scroll.
| hpos | int, new horizontal position |
| void sptk::CListView::imageCollection | ( | Strings & | iconNames | ) |
Sets the images that may be referred from items.
| iconNames | Strings&, a list of icon names |
|
virtual |
Inserts new row.
Optional row argument may be defined inside row parameter, or through ident parameter.
| position | uint32_t, insert position |
| row | const Strings&, row data |
| ident | int, row argument (key value) |
|
protectedvirtual |
Internal mouse callback
Reimplemented in sptk::CDBDropDownListView.
|
protectedvirtual |
The function that allows to overwrite the default text color for the cell.
| column | int, the column number |
| rowData | const CPackedStrings&, row |
|
protectedvirtual |
|
protectedvirtual |
Draws a row in coordinates (internal)
| index | uint32_t, row number |
| rowData | const CPackedStrings *, row pointer |
| x | int, x-coordinate |
| y | int, y-coordinate |
| w | int, width |
| h | int, height |
| focusMode | int, focus flag |
| verticalAlign | int, vertical align |
| paintBackground | bool, true if the item should paint the background |
|
protectedvirtual |
Recomputes items height.
| index | uint32_t, row number |
|
protectedvirtual |
Selects or deselects the item.
| index | uint32_t, item index |
| select | bool, select or deselect |
|
protectedvirtual |
Returns true if item is selected.
| index | uint32_t, item index |
|
protectedvirtual |
Returns item width.
| index | uint32_t, row number |
|
inlineoverridevirtual |
SPTK RTTI information.
Implements sptk::CControl.
References LISTBOX.
|
overrideprotectedvirtual |
Loads control data from XML.
Layout information may also include widget size and position, as well as visible() and active() states
| node | xml::Node*, the XML node |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
Reimplemented from sptk::CControl.
|
overrideprotectedvirtual |
Loads the key value from the query.
Reimplemented from sptk::CControl.
| void sptk::CListView::loadList | ( | const xdoc::SNode & | node | ) |
Fills the list with the data from XML node.
The XML node should contain the columns information, and optional list items
| node | const xml::Node&, the node to load list from |
|
overridevirtual |
Computes the optimal widgets size.
| w | int&, input - width offered by the program, output - width required by widget |
| h | int&, input - height offered by the program, output - height required by widget |
Reimplemented from sptk::CLayoutClient.
|
protected |
Request to redraw line index.
| index | uint32_t, row number |
|
inline |
Requests to redraw just one row
| index | int, row number |
|
virtual |
Removes row.
| index | Row number |
|
override |
Resizes the control and inside widgets.
| x | int, x-position |
| y | int, y-position |
| w | int, width |
| h | int, height |
| CPackedStrings * sptk::CListView::row | ( | uint32_t | index | ) | const |
Returns row pointer
| index | int, row number |
|
overrideprotected |
Saves control data to XML.
Layout information may also include widget size and position, as well as visible() and active() states
| node | xml::Node*, the XML node |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
|
overrideprotectedvirtual |
Saves the key value from the query.
Reimplemented from sptk::CControl.
| void sptk::CListView::saveList | ( | const xdoc::SNode & | node | ) | const |
Saves the list data into XML node.
The XML node should contain the columns information, and optional list items
| node | const xml::Node&, the node to save list into |
|
staticprotected |
Changes the default scrollbar width for the class.
| b | int, new scrollbar width |
|
protected |
Selects the row. Internal.
| index | int, row number |
| sel | bool, true if select |
| docallbacks | bool, true if we want to call callbacks |
|
protected |
Selects the first row. Executes the callbacks. Internal.
|
protected |
Selects the last row. Executes the callbacks. Internal.
|
protected |
Selects the next row. Executes the callbacks. Internal.
|
protected |
Selects the next page row. Executes the callbacks. Internal.
|
protected |
Selects the only row. Internal.
| index | int, row number |
| docallbacks | bool, true if we want to call callbacks |
|
protected |
Selects the prior row. Executes the callbacks. Internal.
|
protected |
Selects the prior page row. Executes the callbacks. Internal.
| int sptk::CListView::selected | ( | int | index | ) | const |
Is row number index selected?
| index | int, row number |
| int sptk::CListView::selectedIndex | ( | ) | const |
Returns the row number for the selected row
| CPackedStrings * sptk::CListView::selectedRow | ( | ) | const |
Returns currently selected row, or the last selected row in case of multiple selection. Returns 0L if there is no selection.
|
inline |
Returns selection list
|
inline |
Selects a row
| index | int, row number |
| sel | bool, true if select |
|
inlineoverride |
Show widget
| void sptk::CListView::show | ( | int | index | ) |
Switch the visibility flag for the row index
| index | int, row number |
| void sptk::CListView::sortAscending | ( | bool | ascending, |
| bool | sortNow | ||
| ) |
Sets the sort direction - ascending/descending.
| ascending | bool, sort direction - ascending/descending |
| sortNow | bool, true if you want to sort immediatedly |
| void sptk::CListView::sortColumn | ( | int | column, |
| bool | sortNow | ||
| ) |
Sets the sort column.
| column | int, sort column number |
| sortNow | bool, true if you want to sort immediatedly |
|
inlineoverridevirtual |
Returns text color.
Reimplemented from sptk::CControl.
|
inlineoverridevirtual |
Sets text color.
Reimplemented from sptk::CControl.
|
inlineoverridevirtual |
Returns text font type.
Reimplemented from sptk::CControl.
|
inlineoverridevirtual |
Sets text font type.
Reimplemented from sptk::CControl.
|
inlineoverridevirtual |
Returns text font size
Reimplemented from sptk::CControl.
|
inlineoverridevirtual |
Sets text font size.
Reimplemented from sptk::CControl.
| std::string sptk::CListView::textValue | ( | ) | const |
Returns the value the selected row and sort column cell
| void sptk::CListView::textValue | ( | const std::string & | text | ) |
Selects the row where cell in the sort column is tv
| text | CString, text to find and select |
|
virtual |
Sets the scroll position.
| index | int, top row number |
|
virtual |
Updates a row. Optional row argument may be defined inside row parameter.
| position | uint32_t, insert position |
| row | const Strings&, row data |
| ident | int, row argument (key value) |
|
virtual |
Updates a row.
Optional row ID may be defined inside row parameter.
| position | uint32_t, insert position |
| row | CPackedStrings *, row data |
|
inlineoverrideprotectedvirtual |
True if the data is valid.
Implements sptk::CControl.
|
inline |
Is the widget visible?
| int sptk::CListView::visible | ( | int | index | ) | const |
Is the row visible?
| index | int, row number |
|
protected |
The row where the focus is or should be
|
protected |
Auto row height on/off
|
protected |
Should the column headers to be capitilized?
|
protected |
The list of columns
|
protected |
Text font, currently used to draw the list view
|
protected |
Text size, currently used to draw the list view
|
protected |
Data mode Defines the kind of data to work through data() method.
|
protected |
Dragged column
|
protected |
Dragging column started
|
protected |
The height of the header area
|
protected |
The horizontal position - to be
|
protected |
Icon names that may be referred from items (icon size is 16)
|
protected |
The maximum required width for the columns
|
protected |
The mouse pressed position
|
protected |
Is multiple selection allowed?
|
protected |
The horizontal position - existing
|
protected |
The minimal update pointer
|
protected |
The minimal update pointer
|
protected |
The list of rows
|
staticprotected |
Scrollbar width for this class of object
|
protected |
Type-in search buffer
|
protected |
The list of currently selected items
|
protected |
Show/hide cell grid. Grid is an alternative to stripes.
|
protected |
Show/hide selection
|
protected |
Show/hide horizontal stripes. Stripes is an alternative to cell grid.
|
protected |
The text font color
|
protected |
The text font type
|
protected |
The text font size
|
protected |
The scrolling position