sptk2 logo
SPTK Home Page

sptk::CListView Class Reference
[GUI Classes]

List view widget. More...

#include <CListView.h>

Inheritance diagram for sptk::CListView:

sptk::CControl sptk::CSynchronized sptk::CLayoutClient sptk::CDBListView sptk::CDBDropDownListView

List of all members.

Public Member Functions

 CListView (const char *label=0, int layoutSize=20, CLayoutAlign layoutAlign=SP_ALIGN_TOP)
 Constructor in SPTK style.
 ~CListView ()
 Destructor.
int handle (int)
 Overwritten handle().
void resize (int x, int y, int w, int h)
 Resizes the control and inside widgets.
virtual void removeRow (uint32_t index)
 Removes row.
virtual void addRow (int ident, const char *s1, const char *s2=NULL, const char *s3=NULL, const char *s4=NULL, const char *s5=NULL)
 Adds new row.
virtual void addRow (int count, const char *strings[], int ident=0)
 Adds new row.
virtual void addRow (CPackedStrings *row)
 Adds new row.
virtual void addRow (const CStrings &row, int ident=0)
 Adds new row.
virtual void insertRow (uint32_t position, CPackedStrings *row)
 Inserts new row.
virtual void insertRow (uint32_t position, const CStrings &row, int ident=0)
 Inserts new row.
virtual void updateRow (uint32_t position, CPackedStrings *row)
 Updates a row.
virtual void updateRow (uint32_t position, const CStrings &row, int ident=0)
 Updates a row. Optional row argument may be defined inside row parameter.
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.
int selected (int index) const
void show (int index)
void hide (int index)
void hide ()
 Hides the list view widget.
int visible (int index) const
int visible () const
 Is the widget visible?
std::string textValue () const
 Returns the value the selected row and sort column cell.
void textValue (std::string text)
void dataMode (CListViewDataMode dm)
CListViewDataMode dataMode ()
virtual CVariant data () const
virtual void data (const CVariant v)
CPackedStringsrow (uint32_t index) const
const CSelectionselection () const
 Returns selection list.
CPackedStringsselectedRow () const
int selectedIndex () const
 Returns the row number for the selected row.
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.
CColumnListcolumns ()
 Returns column list.
CColumncolumn (uint32_t col)
 Returns column informartion.
CColumncolumn (const char *colname)
 Returns column informartion.
void addColumn (const CColumn &column)
 Adds a new column as a copy of column.
void addColumn (const std::string colname, CVariantType type, uint32_t cwidth=100, bool cvisible=true)
 Adds a new column as a copy of column.
virtual CControlKind kind () const
 SPTK RTTI information.
bool autoRowHeight ()
 Returns auto row height mode as true/false.
void autoRowHeight (bool arh)
 Sets auto row height mode as true/false.
Fl_Font textFont () const
 Returns text font type.
void textFont (Fl_Font f)
 Sets text font type.
uchar textSize () const
 Returns text font size.
void textSize (uchar s)
 Sets text font size.
Fl_Color textColor () const
 Returns text color.
void textColor (Fl_Color n)
 Sets text color.
bool showGrid ()
 Returns show grid mode.
void showGrid (bool flag)
 Sets show grid mode.
bool showStripes ()
 Returns show stripes.
void showStripes (bool flag)
 Sets show stripes mode.
bool showSelection ()
 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 (CIntList &selection) const
 Returns a selected rows ID list.
void setSelections (const CIntList &selection)
 Sets a selected rows ID list.
CPackedStringsfindCaption (std::string caption)
 Finds an item with the caption (a string in the first column).
CPackedStringsfindKey (int keyValue)
 Finds an item with the key (an integer associated with the item - argument()).
uint32_t fullWidth () const
 Returns maximum width of all items including the header row.
uint32_t fullHeight ()
 Returns summary height of all items including the header row.
virtual int findString (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().
std::string sortColumnName () const
 Returns sort column name.
void sortColumn (int column, bool sortNow)
 Sets the sort column.
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.
void sort ()
 Sorts ListView rows using existing information about sort column and direction.
void fill (CDataSource &ds, std::string keyFieldName="", uint32_t recordsLimit=0, uint32_t recordsEstimated=0, CRefreshKind refreshKind=LV_REFRESH_FULL)
 Fills the list view with the data from datasource.
void loadList (const CXmlNode *node)
 Fills the list with the data from XML node.
void saveList (CXmlNode *node) const
 Saves the list data into XML node.
virtual bool preferredSize (int &w, int &h)
 Computes the optimal widgets size.
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.
void terminateFill ()
 Terminate the current fill() operation (if in progress).
virtual std::string className () const
 Returns widget class name (internal SPTK RTTI).
void imageCollection (CStrings &iconNames)
 Sets the images that may be referred from items.

Protected Member Functions

int columnAt (int x)
 Computes which column contains x-coordinate.
int find_item (int y)
 Finds an item in vertical position y.
void bbox (int &X, int &Y, int &W, int &H) const
 Returns the actual size of the drawing area (internal).
int hposition () const
 Returns horizontal position of the scroll.
void hposition (int hpos)
 Sets horizontal position of the scroll.
int find_id (int id) const
 Finds item with ID.
virtual int get_focus ()
 Get focus callback (internal).
virtual bool item_selected (uint32_t index) const
 Returns true if item is selected.
virtual void item_select (uint32_t index, bool select)
 Selects or deselects the item.
virtual int item_compute_height_all ()
 Recomputes all items height.
virtual int item_compute_height (CPackedStrings *rowData)
 Recomputes items height.
virtual int item_height (uint32_t index) const
 Recomputes items height.
virtual int item_width (uint32_t index) const
 Returns item width.
virtual void item_draw (uint32_t index, const CPackedStrings *rowData, int x, int y, int w, int h, int focusMode, int verticalAlign, bool paintBackground=true) const
 Draws a row in coordinates (internal).
virtual void item_clicked (int mouse_btn)
 Internal mouse callback.
virtual Fl_Color item_color (int column, const CPackedStrings &rowData) const
 The function that allows to overwrite the default text color for the cell.
virtual void header_draw (int x, int y, int hh) const
 Draws header (internal).
virtual void header_clicked (int x)
 Header clicked mouse callback.
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.
virtual void header_released (int x)
 Header released in position x notification.
void redraw_line (uint32_t index)
 Request to redraw line index.
void redraw_lines ()
 Redraw all the lines.
virtual void draw ()
 General draw function. Draws everything.
void key_changed (uint32_t index)
 Internal callback if selected another item with the different user _data (key).
virtual void load (CQuery *)
 Loads the key value from the query.
virtual void save (CQuery *)
 Saves the key value from the query.
virtual void load (const CXmlNode *node, CLayoutXMLmode xmlMode)
 Loads control data from XML.
virtual void save (CXmlNode *node, CLayoutXMLmode xmlMode) const
 Saves control data to XML.
virtual bool valid () const
 True if the data is valid.
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.
bool select_only (uint32_t index, bool docallbacks=false)
 Selects the only row. Internal.
bool activate_row (uint32_t index)
 Selects the row. Executes the callbacks. Internal.
bool select_first ()
 Selects the first row. Executes the callbacks. Internal.
bool select_last ()
 Selects the last row. Executes the callbacks. Internal.
bool select_next ()
 Selects the next row. Executes the callbacks. Internal.
bool select_prior ()
 Selects the prior row. Executes the callbacks. Internal.
bool select_next_page ()
 Selects the next page row. Executes the callbacks. Internal.
bool select_prior_page ()
 Selects the prior page row. Executes the callbacks. Internal.

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.
static int scrollbar_width ()
 Returns the default scrollbar width for the class.

Protected Attributes

bool m_capitalizeColumnNames
 Should the column headers to be capitilized?
bool m_multipleSelection
 Is multiple selection allowed?
int m_horizPosition
 The horizontal position - to be.
int m_realHorizPosition
 The horizontal position - existing.
int m_maxWidth
 The maximum required width for the columns.
int m_redraw1
 The minimal update pointer.
int m_redraw2
 The minimal update pointer.
uint32_t m_top
 The scrolling position.
int m_currentTextFont
 Text font, currently used to draw the list view.
int m_currentTextSize
 Text size, currently used to draw the list view.
CStrings m_iconNames
 Icon names that may be referred from items (icon size is 16).
CListViewDataMode m_dataMode
 Data mode Defines the kind of data to work through data() method.
int m_mousePressedX
 The mouse pressed position.
CSelection m_selection
 The list of currently selected items.
std::string m_searchPhrase
 Type-in search buffer.
uint32_t m_activeRow
 The row where the focus is or should be.
uint32_t m_headerHeight
 The height of the header area.
CListViewRows m_rows
 The list of rows.
CColumnList m_columnList
 The list of columns.
int m_draggingColumn
 Dragged column.
int m_draggingStarted
 Dragging column started.
Fl_Font m_textFont
 The text font type.
uchar m_textSize
 The text font size.
Fl_Color m_textColor
 The text font color.
bool m_showStripes
 Show/hide horizontal stripes. Stripes is an alternative to cell grid.
bool m_showGrid
 Show/hide cell grid. Grid is an alternative to stripes.
bool m_showSelection
 Show/hide selection.
bool m_autoRowHeight
 Auto row height on/off.
CScrollBar scrollbar
 Vertical scrollback.
CScrollBar hscrollbar
 Horizontal scrollbar.

Static Protected Attributes

static int m_scrollbarWidth
 Scrollbar width for this class of object.

Friends

class CInternalComboBoxPanel
class CDBDropDownList


Detailed Description

List view widget.

Class CListView is the list of multicolumn rows. It allows to sort rows by column, supports type-in incremental search etc.


Constructor & Destructor Documentation

sptk::CListView::CListView ( const char *  label = 0,
int  layoutSize = 20,
CLayoutAlign  layoutAlign = SP_ALIGN_TOP 
)

Constructor in SPTK style.

Parameters:
label const char *, label
layoutSize int, widget align in layout
layoutAlign CLayoutAlign, widget align in layout


Member Function Documentation

bool sptk::CListView::activate_row ( uint32_t  index  )  [protected]

Selects the row. Executes the callbacks. Internal.

Parameters:
index int, row number
Returns:
true if success

void sptk::CListView::addColumn ( const std::string  colname,
CVariantType  type,
uint32_t  cwidth = 100,
bool  cvisible = true 
) [inline]

Adds a new column as a copy of column.

Parameters:
colname const char *, column name
type CVariantType, column data type
cwidth uint32_t, column width
cvisible bool, is the column visible?

void sptk::CListView::addColumn ( const CColumn column  )  [inline]

Adds a new column as a copy of column.

Parameters:
column const CColumn&, new column information

virtual void sptk::CListView::addRow ( const CStrings row,
int  ident = 0 
) [virtual]

Adds new row.

Optional row ID may be defined inside row parameter, or through ident parameter.

Parameters:
row const CStrings&, row data
ident int, row argument (key value)

virtual void sptk::CListView::addRow ( CPackedStrings row  )  [virtual]

Adds new row.

Optional row ID may be defined inside row parameter.

Parameters:
row CPackedStrings *, row data

virtual void sptk::CListView::addRow ( int  count,
const char *  strings[],
int  ident = 0 
) [virtual]

Adds new row.

Parameters:
count int, number of items in strings
strings char * [], row data
ident int, row argument (key value)

virtual void sptk::CListView::addRow ( int  ident,
const char *  s1,
const char *  s2 = NULL,
const char *  s3 = NULL,
const char *  s4 = NULL,
const char *  s5 = NULL 
) [virtual]

Adds new row.

Parameters:
ident int, row argument (key value)
s1 const char *, text data for the column 1
s2 const char *, text data for the column 2
s3 const char *, text data for the column 3
s4 const char *, text data for the column 4
s5 const char *, text data for the column 5

void sptk::CListView::bbox ( int &  X,
int &  Y,
int &  W,
int &  H 
) const [protected]

Returns the actual size of the drawing area (internal).

Parameters:
X int, output, x-xoordinate
Y int, output, y-xoordinate
W int, output, width
H int, output, height

void sptk::CListView::capitalizeColumnNames ( bool  ccn  )  [inline]

Defines if column names should be auto-capitilized.

Parameters:
ccn bool, true if column names should be auto-capitilized

CColumn& sptk::CListView::column ( const char *  colname  ) 

Returns column informartion.

Parameters:
colname const char *, column name

CColumn& sptk::CListView::column ( uint32_t  col  )  [inline]

Returns column informartion.

Parameters:
col uint32_t, column number 0..columnCount() -1

int sptk::CListView::columnAt ( int  x  )  [protected]

Computes which column contains x-coordinate.

Parameters:
x int, coordinate
Returns:
column number

void sptk::CListView::columns ( const CColumnList columns  ) 

Sets a new column list.

Parameters:
columns const CColumnList&, new column list

virtual void sptk::CListView::data ( const CVariant  v  )  [virtual]

The universal data connector, selects row with user data

Parameters:
v const CVariant, user data value to find and select

Reimplemented from sptk::CControl.

virtual CVariant sptk::CListView::data (  )  const [virtual]

The universal data connector,

Returns:
control data

Reimplemented from sptk::CControl.

CListViewDataMode sptk::CListView::dataMode (  )  [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.

See also:
CListViewDataMode for more information

void sptk::CListView::dataMode ( CListViewDataMode  dm  )  [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.

See also:
CListViewDataMode for more information

bool sptk::CListView::displayed ( uint32_t  index  )  const

Returns true if the row is currently visible in the scroll area

Parameters:
index int, row number

virtual void sptk::CListView::displayRow ( uint32_t  index  )  [virtual]

Makes the row visible in the scroll area

Parameters:
index int, row number

void sptk::CListView::fill ( CDataSource ds,
std::string  keyFieldName = "",
uint32_t  recordsLimit = 0,
uint32_t  recordsEstimated = 0,
CRefreshKind  refreshKind = LV_REFRESH_FULL 
)

Fills the list view with the data from datasource.

Uses all available datasource information about column and data types.

Parameters:
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
See also:
CRefreshKind

CDataSource

int sptk::CListView::find_id ( int  id  )  const [protected]

Finds item with ID.

Parameters:
id int, item id
Returns:
row number, or -1 if not found

int sptk::CListView::find_item ( int  y  )  [protected]

Finds an item in vertical position y.

Parameters:
y int, vertical position
Returns:
row number, or -1 if not found

CPackedStrings* sptk::CListView::findCaption ( std::string  caption  ) 

Finds an item with the caption (a string in the first column).

Parameters:
caption std::string, the caption to find and select.
Returns:
an item, or NULL if item caption is not found

CPackedStrings* sptk::CListView::findKey ( int  keyValue  ) 

Finds an item with the key (an integer associated with the item - argument()).

Parameters:
keyValue int, the caption to find and select.
Returns:
an item, or NULL if item caption is not found

virtual int sptk::CListView::findString ( std::string  str,
bool  select = true,
uint32_t  startRow = 0,
uint32_t  endRow = 0 
) [virtual]

Finds a string in the sort column of list view defined with sortColumn().

Parameters:
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
Returns:
the row number, or -1 if not found

virtual void sptk::CListView::header_clicked ( int  x  )  [protected, virtual]

Header clicked mouse callback.

Parameters:
x int, x-coordinate

virtual void sptk::CListView::header_dragged ( int  x  )  [protected, virtual]

Header dragged to position x notification.

Parameters:
x int, x-coordinate

virtual void sptk::CListView::header_draw ( int  x,
int  y,
int  hh 
) const [protected, virtual]

Draws header (internal).

Parameters:
x int, x-coordinate
y int, y-coordinate
hh int, header height

virtual void sptk::CListView::header_released ( int  x  )  [protected, virtual]

Header released in position x notification.

Parameters:
x int, x-coordinate

void sptk::CListView::hide ( int  index  ) 

Switch the visibility flag for the row index

Parameters:
index int, row number

void sptk::CListView::hposition ( int  hpos  )  [protected]

Sets horizontal position of the scroll.

Parameters:
hpos int, new horizontal position

void sptk::CListView::imageCollection ( CStrings iconNames  ) 

Sets the images that may be referred from items.

Parameters:
iconNames CStrings&, a list of icon names

virtual void sptk::CListView::insertRow ( uint32_t  position,
const CStrings row,
int  ident = 0 
) [virtual]

Inserts new row.

Optional row argument may be defined inside row parameter, or through ident parameter.

Parameters:
position uint32_t, insert position
row const CStrings&, row data
ident int, row argument (key value)

virtual void sptk::CListView::insertRow ( uint32_t  position,
CPackedStrings row 
) [virtual]

Inserts new row.

Optional row ID may be defined inside row parameter.

Parameters:
position uint32_t, insert position
row CPackedStrings *, row data

virtual Fl_Color sptk::CListView::item_color ( int  column,
const CPackedStrings rowData 
) const [protected, virtual]

The function that allows to overwrite the default text color for the cell.

Parameters:
column int, the column number
rowData const CPackedStrings&, row
Returns:
textColor()

virtual int sptk::CListView::item_compute_height ( CPackedStrings rowData  )  [protected, virtual]

Recomputes items height.

Parameters:
rowData CPackedStrings *, item pointer
Returns:
item height

virtual void sptk::CListView::item_draw ( uint32_t  index,
const CPackedStrings rowData,
int  x,
int  y,
int  w,
int  h,
int  focusMode,
int  verticalAlign,
bool  paintBackground = true 
) const [protected, virtual]

Draws a row in coordinates (internal).

Parameters:
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
Returns:
item width

virtual int sptk::CListView::item_height ( uint32_t  index  )  const [protected, virtual]

Recomputes items height.

Parameters:
index uint32_t, row number
Returns:
item height

virtual void sptk::CListView::item_select ( uint32_t  index,
bool  select 
) [protected, virtual]

Selects or deselects the item.

Parameters:
index uint32_t, item index
select bool, select or deselect

virtual bool sptk::CListView::item_selected ( uint32_t  index  )  const [protected, virtual]

Returns true if item is selected.

Parameters:
index uint32_t, item index

virtual int sptk::CListView::item_width ( uint32_t  index  )  const [protected, virtual]

Returns item width.

Parameters:
index uint32_t, row number
Returns:
item width

virtual CControlKind sptk::CListView::kind (  )  const [inline, virtual]

SPTK RTTI information.

Returns:
control type as CControlKind
See also:
CControlKind

Implements sptk::CControl.

References sptk::DCV_LISTBOX.

virtual void sptk::CListView::load ( const CXmlNode node,
CLayoutXMLmode  xmlMode 
) [protected, virtual]

Loads control data from XML.

Layout information may also include widget size and position, as well as visible() and active() states

Parameters:
node CXmlNode*, the XML node
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be stored

Reimplemented from sptk::CControl.

void sptk::CListView::loadList ( const CXmlNode node  ) 

Fills the list with the data from XML node.

The XML node should contain the columns information, and optional list items

Parameters:
node const CXmlNode&, the node to load list from

virtual bool sptk::CListView::preferredSize ( int &  w,
int &  h 
) [virtual]

Computes the optimal widgets size.

Parameters:
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
Returns:
true if the size is stable (doesn't depend on input sizes)

Reimplemented from sptk::CLayoutClient.

void sptk::CListView::redraw_line ( uint32_t  index  )  [protected]

Request to redraw line index.

Parameters:
index uint32_t, row number

void sptk::CListView::redrawRow ( uint32_t  index  )  [inline]

Requests to redraw just one row

Parameters:
index int, row number

virtual void sptk::CListView::removeRow ( uint32_t  index  )  [virtual]

Removes row.

Parameters:
index uint32_t, row number

void sptk::CListView::resize ( int  x,
int  y,
int  w,
int  h 
) [virtual]

Resizes the control and inside widgets.

Parameters:
x int, x-position
y int, y-position
w int, width
h int, height

Reimplemented from sptk::CControl.

CPackedStrings* sptk::CListView::row ( uint32_t  index  )  const

Returns row pointer

Parameters:
index int, row number
Returns:
row pointer

virtual void sptk::CListView::save ( CXmlNode node,
CLayoutXMLmode  xmlMode 
) const [protected, virtual]

Saves control data to XML.

Layout information may also include widget size and position, as well as visible() and active() states

Parameters:
node CXmlNode*, the XML node
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be stored

Reimplemented from sptk::CControl.

void sptk::CListView::saveList ( CXmlNode node  )  const

Saves the list data into XML node.

The XML node should contain the columns information, and optional list items

Parameters:
node const CXmlNode&, the node to save list into

static void sptk::CListView::scrollbar_width ( int  b  )  [inline, static, protected]

Changes the default scrollbar width for the class.

Parameters:
b int, new scrollbar width

bool sptk::CListView::select ( uint32_t  index,
bool  sel = true,
int  docallbacks = false 
) [protected]

Selects the row. Internal.

Parameters:
index int, row number
sel bool, true if select
docallbacks bool, true if we want to call callbacks
Returns:
true if success

bool sptk::CListView::select_first (  )  [protected]

Selects the first row. Executes the callbacks. Internal.

Returns:
true if success

bool sptk::CListView::select_last (  )  [protected]

Selects the last row. Executes the callbacks. Internal.

Returns:
true if success

bool sptk::CListView::select_next (  )  [protected]

Selects the next row. Executes the callbacks. Internal.

Returns:
true if success

bool sptk::CListView::select_next_page (  )  [protected]

Selects the next page row. Executes the callbacks. Internal.

Returns:
true if success

bool sptk::CListView::select_only ( uint32_t  index,
bool  docallbacks = false 
) [protected]

Selects the only row. Internal.

Parameters:
index int, row number
docallbacks bool, true if we want to call callbacks
Returns:
true if success

bool sptk::CListView::select_prior (  )  [protected]

Selects the prior row. Executes the callbacks. Internal.

Returns:
true if success

bool sptk::CListView::select_prior_page (  )  [protected]

Selects the prior page row. Executes the callbacks. Internal.

Returns:
true if success

int sptk::CListView::selected ( int  index  )  const

Is row number index selected?

Parameters:
index int, row number

CPackedStrings& sptk::CListView::selectedRow (  )  const

Returns currently selected row, or the last selected row in case of multiple selection. Returns 0L reference if there is no selection.

bool sptk::CListView::selectRow ( uint32_t  index,
bool  sel = true 
) [inline]

Selects a row

Parameters:
index int, row number
sel bool, true if select
Returns:
true if success

void sptk::CListView::show ( int  index  ) 

Switch the visibility flag for the row index

Parameters:
index int, row number

void sptk::CListView::sortAscending ( bool  ascending,
bool  sortNow 
)

Sets the sort direction - ascending/descending.

Parameters:
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.

Parameters:
column int, sort column number
sortNow bool, true if you want to sort immediatedly

void sptk::CListView::textValue ( std::string  text  ) 

Selects the row where cell in the sort column is tv

Parameters:
text CString, text to find and select

virtual void sptk::CListView::top ( int  index  )  [virtual]

Sets the scroll position.

Parameters:
index int, top row number

virtual void sptk::CListView::updateRow ( uint32_t  position,
const CStrings row,
int  ident = 0 
) [virtual]

Updates a row. Optional row argument may be defined inside row parameter.

Parameters:
position uint32_t, insert position
row const CStrings&, row data
ident int, row argument (key value)

virtual void sptk::CListView::updateRow ( uint32_t  position,
CPackedStrings row 
) [virtual]

Updates a row.

Optional row ID may be defined inside row parameter.

Parameters:
position uint32_t, insert position
row CPackedStrings *, row data

int sptk::CListView::visible ( int  index  )  const

Is the row visible?

Parameters:
index int, row number


Member Data Documentation

Data mode Defines the kind of data to work through data() method.

See also:
CListViewDataMode for more information


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:16 2012: SPTK 3.5.7