gtkIOStream
1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
|
Selection GtkTreeView based widget Inherits from a LinkList of GtkTreeViewColumn* which allows modification of the columns. More...
#include <Selection.H>
Public Member Functions | |
Selection (void) | |
Selection (const char *listName, GCallback callback=NULL, void *data=NULL) | |
virtual | ~Selection () |
void | init (const char *listName, GCallback callback=NULL, void *data=NULL) |
void | setSelectionCallback (GCallback callback) |
void | setSelectionCallback (const char *event, GCallback callback, gpointer data) |
void | setTreeCallback (const char *event, GCallback callback, gpointer data) |
void | add (SelectionColumn *newCol) |
void | setCallbackAfter (GCallback callback, void *data) |
change the callback data to be returned with the callback. More... | |
GtkWidget * | getWidget (void) |
void | show (void) |
void | hide (void) |
void | getSelection (char *value) |
void | getSelection (string &value) |
void | add (const char *text, gboolean sameRow=false, gboolean sameColumn=true) |
void | add (GdkPixbuf *pixbuf, gboolean sameRow=false, gboolean sameColumn=true) |
void | clear (void) |
Selection & | operator<< (const string text) |
Selection & | operator<< (const char *text) |
Selection & | operator<< (GdkPixbuf *pixbuf) |
Selection & | operator<< (SelectionColumn *newCol) |
void | selectRow (char *path) |
Public Member Functions inherited from LinkList< SelectionColumn *> | |
LinkList (void) | |
Initialiser This is for the first element - links to itself. More... | |
virtual | ~LinkList (void) |
Small cleanup ... More... | |
void | add (SelectionColumn * newElement) |
Adds as the current element ... Added to the next of the current lug. More... | |
SelectionColumn * | change (SelectionColumn * changeElement) |
exchange lugs The current lug is replaced with this lug. More... | |
SelectionColumn * | remove (void) |
remove the current lug from the LinkList The current lug is removed form the list and passed back to the caller. More... | |
SelectionColumn * | current (void) |
return a pointer to the current lug More... | |
SelectionColumn * | next (void) |
Return a pointer to the next lug and move on to that lug Increments according to dir (either forward or backwards). More... | |
SelectionColumn * | prev (void) |
Return a pointer to the previous lug and move to that lug Increments against dir (either forward or backwards). More... | |
SelectionColumn * | grab (int i) |
returns the i'th lug in the chain irrespective of direction More... | |
int | getCount (void) |
SelectionColumn * | getEnd () |
Protected Member Functions | |
int | currentColumnNumber (void) |
Protected Attributes | |
GtkWidget * | tree |
The tree of items for the selection widget. More... | |
GtkTreeSelection * | selection |
The tree selection box. More... | |
Private Member Functions | |
void | init (void) |
GtkTreeIter * | getLastIter (GtkTreeStore *store=NULL) |
GtkTreeIter * | appendRow (GtkTreeStore *store=NULL) |
GtkTreeIter * | appendNewIter (GtkTreeStore *store, gboolean sameRow, gboolean sameColumn) |
Private Attributes | |
gulong | changedHandlerID |
The callback handler id for when the selection is changed. More... | |
Additional Inherited Members | |
Public Types inherited from LinkList< SelectionColumn *> | |
enum | direction |
Public Attributes inherited from LinkList< SelectionColumn *> | |
direction | dir |
The current direction. More... | |
Selection GtkTreeView based widget Inherits from a LinkList of GtkTreeViewColumn* which allows modification of the columns.
In its simplest form, you can easily generate a text selection like so :
In a more complex form, you can have many columns, in this case text and a pixbuf :
Definition at line 238 of file Selection.H.
|
inline |
Simple constructor, giving a Selection class with no columns.
Definition at line 339 of file Selection.H.
|
inline |
Construct a Selection widget with one column and assigns a callback When this constructor is used, one text column is added. This automates everything for you if you only want a simple text column selection.
listName | The title for the Selection |
callback | the callback to use when a selection is made |
data | User data to pass to the callback. |
Definition at line 349 of file Selection.H.
|
inlinevirtual |
Definition at line 353 of file Selection.H.
|
inline |
add a new column to the Selection
Definition at line 413 of file Selection.H.
|
inline |
add a text item to the selection column if you want to add to a different column, shift the inherited LinkList<SelectionColumn *> to the correct one. For example use one of these to locate the desired column prior to adding : LinkList<SelectionColumn *>::grab, LinkList<SelectionColumn *>::next, LinkList<SelectionColumn *>::prev
text | the text item to add to the list |
sameRow | Use the same row. Defaults to false, append a new row |
sameColumn | Use the same column, defaults to true |
Definition at line 513 of file Selection.H.
|
inline |
add a pixbuf item to the selection column if you want to add to a different column, shift the inherited LinkList<SelectionColumn *> to the correct one. For example use one of these to locate the desired column prior to adding : LinkList<SelectionColumn *>::grab, LinkList<SelectionColumn *>::next, LinkList<SelectionColumn *>::prev
pixbuf | the GdkPixbuf item to add to the list |
sameRow | Use the same row. Defaults to false, append a new row |
sameColumn | Use the same column, defaults to true |
Definition at line 532 of file Selection.H.
|
inlineprivate |
Get a GtkTreeIter. If the sameRow is requested, try to get it, if no rows, then create a new row and append as last.
store | The GtkTreeStore to append a row to |
sameRow | try to return the last row as the iter if true, otherwise, create a new row and append |
sameColumn | don't increment the column, use the same column |
Definition at line 302 of file Selection.H.
|
inlineprivate |
append a row to a given store The returned row must be deleted
store | The GtkTreeStore to append a row to, can be null to use the store associated with the tree |
Definition at line 284 of file Selection.H.
|
inline |
Clear all the contents of the selection
Definition at line 545 of file Selection.H.
|
inlineprotected |
Find which column is current
Definition at line 322 of file Selection.H.
|
inlineprivate |
Get the last root row of the tree store
store | The GtkTreeStore to append a row to, can be null to use the store associated with the tree |
Definition at line 269 of file Selection.H.
|
inline |
Get the selected text from the current() column
value | The character array to hold the selected text. NOTE: Ensure the length of the char * passed in is large enough to contain the selected text. |
Definition at line 478 of file Selection.H.
|
inline |
Get the selected text from the current() column
value | The character array to hold the selected text. |
Definition at line 487 of file Selection.H.
|
inline |
Gets the widget for loading into containers
Definition at line 459 of file Selection.H.
|
inline |
A method to hide the Selection widget
Definition at line 471 of file Selection.H.
|
inlineprivate |
Initialise this class - common to all constructors.
Definition at line 244 of file Selection.H.
|
inline |
Initialise a new Selection GUI. Adds a new column and the related callback
listName | The title for the Selection |
callback | the callback to use when a selection is made (if callback==NULL then it is not connected) |
data | the user data to pass to the selection callback static method. |
Definition at line 363 of file Selection.H.
|
inline |
add a text item to the Selection column if you want to add to a different column, shift the inherited LinkList<SelectionColumn *> to the correct one. For example use one of these to locate the desired column prior to adding : LinkList<SelectionColumn *>::grab, LinkList<SelectionColumn *>::next, LinkList<SelectionColumn *>::prev
text | the text item to add |
Definition at line 604 of file Selection.H.
|
inline |
add a text item to the Selection column if you want to add to a different column, shift the inherited LinkList<SelectionColumn *> to the correct one. For example use one of these to locate the desired column prior to adding : LinkList<SelectionColumn *>::grab, LinkList<SelectionColumn *>::next, LinkList<SelectionColumn *>::prev
text | the text item to add |
Definition at line 615 of file Selection.H.
|
inline |
add a GdkPixbuf item to the Selection column. If you want to add to a different column, shift the inherited LinkList<SelectionColumn *> to the correct one. For example use one of these to locate the desired column prior to adding : LinkList<SelectionColumn *>::grab, LinkList<SelectionColumn *>::next, LinkList<SelectionColumn *>::prev
pixbuf | the text item to add |
Definition at line 626 of file Selection.H.
|
inline |
add a new column to the Selection.
newCol | the SelectionColumn to add |
Definition at line 645 of file Selection.H.
|
inline |
Activates a row for the current LinkList selected column For example :
path | a GtkTreePath string, such as "A" for a root node number A or "A:B:C" root node A, sub-node B, sub-node C. |
Definition at line 659 of file Selection.H.
|
inline |
change the callback data to be returned with the callback.
callback | the callback function to be called upon selection change |
data | the data to be returned with the selection changed callback. |
Definition at line 453 of file Selection.H.
|
inline |
Calls the callback when the "changed" event is called on the selection.
callback | The callback to call when a "changed" event is caught |
Definition at line 383 of file Selection.H.
|
inline |
Setup a new selection callback
event | The event to connect to |
callback | The callback to call when the event is encountered |
data | The user data to pass to the callback |
Definition at line 392 of file Selection.H.
|
inline |
Sets the tree to call the callback when the button is released. This is good for generic event and table related event handling. For example your class could use the following :
event | The event to connect to. |
callback | The callback to execute when the button is released (after clicking the tree) |
data | The user data to pass to the callback on execution. |
Definition at line 407 of file Selection.H.
|
inline |
A method to show the Selection widget
Definition at line 465 of file Selection.H.
|
private |
The callback handler id for when the selection is changed.
Definition at line 240 of file Selection.H.
|
protected |
The tree selection box.
Definition at line 317 of file Selection.H.
|
protected |
The tree of items for the selection widget.
Definition at line 316 of file Selection.H.
GTK+ IOStream
Beta
|