vdk 2.4.0
Public Member Functions | Public Attributes
VDKCustomList Class Reference

This class wraps gtkclist widget. More...

#include <vdkclist.h>

Inheritance diagram for VDKCustomList:
VDKCustom VDKObject VDKNotCopyAble VDKCustomSortedList

List of all members.

Public Member Functions

Public Attributes


Detailed Description

This class wraps gtkclist widget.

Signals
  • select_row signal, emitted on selecting a list cell (or double clicking on extended selection mode). Selected property contains selected cell coordinates. Selected is set to VDKPoint(-1,-1) if no cell is selected.
  • unselect_row_signal, emitted on unselecting a cell. Unselected property contains unselected cell coordinates.
  • click_column_signal, emitted on clicking over a column titile, ColumnClicked() returns wich column was clicked.
Tip
Use Selected property property like this:
  VDKPoint p = list->Selected;
  int row = p.x;
  int col = p.y;
  // or simpler
  int row = list->Selected.Row();
  int col = list->Selected.Col();
Programming hints
Data contained into a VDKCustomList are organized as a list of tuples, a VDKTuple is a derived clas of an VDKArray<VDKString> that add equality and less-than operators (See vdkclist.h for further informations). You can access to data using [] operator on Tuples property like this:
  VDKTuple tuple = list->Tuples[j]; // access to j-th tuple
  VDKString s = list->Tuples[j][i]; // access to j-th,i-th string
Recall that Tuples is a read-only property, directly modifying a tuple does not reflect into the list widget, use VDKCustomList::UpdateRow() method at this end.
Examples
Into ./testvdk/testvdk.cc and .h

Constructor & Destructor Documentation

VDKCustomList::VDKCustomList ( VDKForm owner,
int  columns = 1,
char **  titles = NULL,
GtkSelectionMode  mode = GTK_SELECTION_SINGLE 
)

Constructor.

Parameters:
columnscolumns number
titlesarray of titles strings
modeselection mode

Destructor


Member Function Documentation

void VDKCustomList::AddRow ( char **  texts,
char **  pixdata = NULL,
int  col = 0 
)

Add a row to list.

Parameters:
textsstrings array to fill row cells
pixdataa cell can have a pixmap
wichcolumn has the pixmap (if any)
void VDKCustomList::Clear ( ) [virtual]

Clear widget

Reimplemented from VDKCustom.

void VDKCustomList::RemoveRow ( int  row)

Removes a row

Parameters:
row,whicrow should be removed

Returns selected cell coordinates

Returns an array filled with all selected row number. Valid only in multiple or extended selection mode, in other cases array will have size == 0

void VDKCustomList::SelectRow ( int  row,
int  col 
)

Selects a row

Parameters:
row,cellcoordinate
col
void VDKCustomList::SelectRow ( VDKPoint  p) [inline]

Selects a row

Parameters:
p,cellcoordinates

Returns unselected cell coordinates

void VDKCustomList::UnselectRow ( int  row,
int  col 
)

Unselects a row

Parameters:
row,cellcoordinate
col
void VDKCustomList::UnselectRow ( VDKPoint  p) [inline]

Selects a row

Parameters:
p,cellcoordinates
void VDKCustomList::UpdateCell ( int  row,
int  col,
const char *  s,
char **  pixdata = NULL 
)

Updates a cell

Parameters:
rowcell coordinates
col
pixdataa cell can have a pixmap
wichcolumn has the pixmap (if any)
void VDKCustomList::UpdateRow ( int  row,
char **  s,
char **  pixdata = NULL,
int  col = 0 
)

Updates a row

Parameters:
rowwich row should be updated
pixdataa cell can have a pixmap
wichcolumn has the pixmap (if any)
void VDKCustomList::UpdateRow ( int  row,
Tuple t,
char **  pixdata = NULL,
int  col = 0 
)

Same as above


Member Data Documentation

SelectionProp VDKCustomList::Selected

Use this to know wich cell is selected or Selected.Row() or Selected.Col() <read-only>

A tuple is a VDKArray<VDKString>. use this property to access data on row/cell basis like this:

    Tuple  tuple = list->Tuples[0];
    char * p = (char*) tuple[0];
    // or more simply
    char *p = (char*) list->Tuples[0][0];

Use this to know wich cell is unselected or Unselected.Row() or Unselected.Col() <read-only>


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