VDKCustomList Class Reference
This class wraps gtkclist widget.
More...
#include <vdkclist.h>
List of all members.
Public Member Functions
- VDKCustomList (VDKForm *owner, int columns=1, char **titles=NULL, GtkSelectionMode mode=GTK_SELECTION_SINGLE)
- virtual ~VDKCustomList ()
- void AddRow (char **texts, char **pixdata=NULL, int col=0)
- void UpdateRow (int row, char **s, char **pixdata=NULL, int col=0)
- void UpdateRow (int row, Tuple &t, char **pixdata=NULL, int col=0)
- void UpdateCell (int row, int col, const char *s, char **pixdata=NULL)
- void RemoveRow (int row)
- VDKPoint Selection ()
- VDKPoint Unselection ()
- void SelectRow (int row, int col)
- void SelectRow (VDKPoint p)
- void UnselectRow (int row, int col)
- void UnselectRow (VDKPoint p)
- virtual void Clear ()
- VDKIntArray & Selections ()
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;
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];
VDKString s = list->Tuples[j][i];
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:
-
| columns | columns number |
| titles | array of titles strings |
| mode | selection mode |
VDKCustomList::~VDKCustomList |
( |
|
) |
[virtual] |
Member Function Documentation
void VDKCustomList::AddRow |
( |
char ** |
texts, |
|
|
char ** |
pixdata = NULL , |
|
|
int |
col = 0 | |
|
) |
| | |
Add a row to list.
- Parameters:
-
| texts | strings array to fill row cells |
| pixdata | a cell can have a pixmap |
| wich | column has the pixmap (if any) |
void VDKCustomList::UpdateRow |
( |
int |
row, |
|
|
char ** |
s, |
|
|
char ** |
pixdata = NULL , |
|
|
int |
col = 0 | |
|
) |
| | |
Updates a row
- Parameters:
-
| row | wich row should be updated |
| pixdata | a cell can have a pixmap |
| wich | column has the pixmap (if any) |
void VDKCustomList::UpdateRow |
( |
int |
row, |
|
|
Tuple & |
t, |
|
|
char ** |
pixdata = NULL , |
|
|
int |
col = 0 | |
|
) |
| | |
void VDKCustomList::UpdateCell |
( |
int |
row, |
|
|
int |
col, |
|
|
const char * |
s, |
|
|
char ** |
pixdata = NULL | |
|
) |
| | |
Updates a cell
- Parameters:
-
| row | cell coordinates |
| col | |
| pixdata | a cell can have a pixmap |
| wich | column has the pixmap (if any) |
void VDKCustomList::RemoveRow |
( |
int |
row |
) |
|
Removes a row
- Parameters:
-
| row,whic | row should be removed |
VDKPoint VDKCustomList::Selection |
( |
|
) |
[inline] |
Returns selected cell coordinates
VDKPoint VDKCustomList::Unselection |
( |
|
) |
[inline] |
Returns unselected cell coordinates
void VDKCustomList::SelectRow |
( |
int |
row, |
|
|
int |
col | |
|
) |
| | |
Selects a row
- Parameters:
-
void VDKCustomList::SelectRow |
( |
VDKPoint |
p |
) |
[inline] |
Selects a row
- Parameters:
-
void VDKCustomList::UnselectRow |
( |
int |
row, |
|
|
int |
col | |
|
) |
| | |
Unselects a row
- Parameters:
-
void VDKCustomList::UnselectRow |
( |
VDKPoint |
p |
) |
[inline] |
Selects a row
- Parameters:
-
void VDKCustomList::Clear |
( |
|
) |
[virtual] |
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
Member Data Documentation
Use this to know wich cell is selected or Selected.Row() or Selected.Col() <read-only>
Use this to know wich cell is unselected or Unselected.Row() or Unselected.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];
char *p = (char*) list->Tuples[0][0];
The documentation for this class was generated from the following files: