vdk 2.4.0
Public Member Functions | List of all members
VDKCustomTree Class Reference

This class wraps gtkctree widget. More...

#include <vdkctree.h>

Inheritance diagram for VDKCustomTree:
Inheritance graph
[legend]
Collaboration diagram for VDKCustomTree:
Collaboration graph
[legend]

Public Member Functions

 __rwproperty (VDKCustomTree, int) Spacing
 
 __rwproperty (VDKCustomTree, VDKTreeNode) SelectedNode
 
 __rproperty (VDKCustomTree, int) SelectedColumn
 
 __rwproperty (VDKCustomTree, VDKTreeNode) UnselectedNode
 
 __rproperty (VDKCustomTree, int) UnselectedColumn
 
 __rwproperty (VDKCustomTree, GtkCTreeLineStyle) LineStyle
 
 __rwproperty (VDKCustomTree, GtkCTreeExpanderStyle) ExpanderStyle
 
 VDKCustomTree (VDKForm *owner, int columns=1, char **titles=NULL, GtkSelectionMode mode=GTK_SELECTION_SINGLE, int tree_column=0)
 
virtual ~VDKCustomTree ()
 
VDKTreeNode AddNode (char *text[], GtkCTreeNode *parent, bool expanded=true, bool isLeaf=false, char **pixmap_closed=NULL, char **pixmap_opened=NULL)
 
bool RemoveNode (VDKTreeNode node)
 
int RemoveKey (char *key)
 
virtual void Clear ()
 
VDKTreeNode Selection ()
 
VDKTreeNode Unselection ()
 
VDKTreeNodeArray & Selections ()
 
Tuple operator[] (VDKTreeNode node)
 
VDKTreeNodeList * Find (char *key)
 
bool IsLeaf (VDKTreeNode node)
 
char * Key (VDKTreeNode node)
 
bool IsExpanded (VDKTreeNode node)
 
- Public Member Functions inherited from VDKCustom
int ColumnClicked ()
 
GtkSelectionMode SelectionMode ()
 
GtkWidget * CustomWidget ()
 
void ActiveTitle (int col, bool flag=true)
 
void ActiveTitles (bool flag=true)
 
void EnableTitles (bool flag=true)
 
void Freeze ()
 
void Thaw ()
 
int Size ()
 
void ColumnSize (int col, int size)
 
void AutoResizeColumn (int col, bool flag)
 
virtual void SetForeground (VDKRgb, GtkStateType)
 
virtual void SetFont (VDKFont *)
 
- Public Member Functions inherited from VDKObject
VDKRgb GetBackground (GtkStateType state=GTK_STATE_NORMAL)
 
VDKRgb GetForeground (GtkStateType state=GTK_STATE_NORMAL)
 
 VDKObject (VDKForm *owner=NULL)
 
 VDKObject (VDKForm *owner, GtkWidget *widget)
 
virtual ~VDKObject ()
 
bool Destroy ()
 
virtual int isA ()
 
VDKForm * Owner ()
 
virtual GtkWidget * Widget ()
 
GtkWidget * ConnectingWidget ()
 
GtkWidget * WrappedWidget ()
 
VDKFont * GetFont ()
 
void SetVisible (bool visible)
 
bool GetVisible ()
 
void SetCursor (VDKCursorType)
 
VDKCursorType GetCursor ()
 
void SetSize (int w, int h)
 
void SetUsize (VDKPoint s)
 
virtual void SetTip (char *)
 
virtual void Add (VDKObject *obj, int justify=l_justify, int expand=TRUE, int fill=TRUE, int padding=0)
 
ItemList & Items ()
 
void Draw (GdkRectangle *area=NULL)
 
virtual void Setup ()
 
void SignalEmit (int signal)
 
void SignalEmit (char *sig)
 
void SignalEmitParent (int signal)
 
void SignalEmitParent (char *sig)
 
void GrabFocus ()
 
VDKObject * Parent (VDKObject *p=NULL)
 
int SignalConnect (VDKObject *obj, char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
 
int SignalConnect (char *signal, bool(VDKObject::*method)(VDKObject *), bool gtk=true, bool after=false)
 
bool SignalDisconnect (int connection)
 
int EventConnect (VDKObject *obj, char *event, bool(VDKObject::*method)(VDKObject *, GdkEvent *), bool after=false)
 
int EventConnect (char *, bool(VDKObject::*)(VDKObject *, GdkEvent *), bool after=false)
 
bool EventDisconnect (int connection)
 

Additional Inherited Members

- Public Attributes inherited from VDKCustom
VDKReadWriteValueProp< VDKCustom, GtkPolicyType > VPolicy
 
VDKReadWriteValueProp< VDKCustom, GtkPolicyType > HPolicy
 
VDKReadWriteValueProp< VDKCustom, GtkShadowType > BorderShadow
 
VDKReadWriteValueProp< VDKCustom, int > RowHeight
 
VDKReadWriteValueProp< VDKCustom, bool > AutoResize
 
VDKReadWriteValueProp< VDKCustom, VDKRgb > SelectedForeground
 
VDKReadWriteValueProp< VDKCustom, VDKRgb > UnselectedBackground
 
VDKReadWriteValueProp< VDKCustom, VDKRgb > UnselectedForeground
 
VDKObjectArray Titles
 
VDKReadOnlyValueProp< VDKCustom, int > SelectedTitle
 
- Public Attributes inherited from VDKObject
VDKReadWriteValueProp< VDKObject, VDKRgb > NormalBackground
 
VDKReadWriteValueProp< VDKObject, VDKFont * > Font
 
SizeObjectProp Usize
 
VDKReadWriteValueProp< VDKObject, bool > Enabled
 
VDKReadWriteValueProp< VDKObject, VDKCursorType > Cursor
 
VDKReadWriteValueProp< VDKObject, bool > Visible
 
- Protected Member Functions inherited from VDKCustom
virtual void SetBackground (VDKRgb color, GtkStateType state=GTK_STATE_NORMAL)
 
- Protected Attributes inherited from VDKObject
VDKObjectSignal s_clicked
 
GtkWidget * widget
 
GtkWidget * sigwid
 
VDKObject * parent
 

Detailed Description

This class wraps gtkctree widget.

Signals
  • select_node_signal, emitted on selecting a tree node (or double clicking on extended selection mode). SelectedNode property contains selected node address. SelectedNode is set to NULL if no node is selected.
  • unselect_node_signal, emitted on unselecting a tree node . UnselectedNode property contains uelected node address. UnselectedNode is set to NULL if no node is unselected.
Tip
VDKTreeNode is defined as GtkCTreeNode*
EXAMPLES
On ./testvdk/ctreewin.cc

Constructor & Destructor Documentation

◆ VDKCustomTree()

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

Constructor

Parameters
columns,numberof columns
titles,anarray of title strings
mode,selectionmode
tree_column,keycolumn

◆ ~VDKCustomTree()

VDKCustomTree::~VDKCustomTree ( )
virtual

Destructor

Member Function Documentation

◆ __rproperty() [1/2]

VDKCustomTree::__rproperty ( VDKCustomTree  ,
int   
)

Sets/gets selected column, an answer == -1 means no column selected.

◆ __rproperty() [2/2]

VDKCustomTree::__rproperty ( VDKCustomTree  ,
int   
)

Sets/gets unselected column, an answer == -1 means no column unselected.

◆ __rwproperty() [1/5]

VDKCustomTree::__rwproperty ( VDKCustomTree  ,
int   
)

Sets/gets spacing distance (default 5)

◆ __rwproperty() [2/5]

VDKCustomTree::__rwproperty ( VDKCustomTree  ,
VDKTreeNode   
)

Sets/gets selected node, setting to NULL will select root node. An aswer NULL means no node selected.

◆ __rwproperty() [3/5]

VDKCustomTree::__rwproperty ( VDKCustomTree  ,
VDKTreeNode   
)

Sets/gets unselected node, setting to NULL will unselect root node. An aswer NULL means no node unselected.

◆ __rwproperty() [4/5]

VDKCustomTree::__rwproperty ( VDKCustomTree  ,
GtkCTreeLineStyle   
)

Sets/gets line style arg. (default GTK_CTREE_LINES_SOLID)

◆ __rwproperty() [5/5]

VDKCustomTree::__rwproperty ( VDKCustomTree  ,
GtkCTreeExpanderStyle   
)

Sets/gets expander style (default GTK_CTREE_EXPANDER_SQUARE)

◆ AddNode()

VDKTreeNode VDKCustomTree::AddNode ( char *  text[],
GtkCTreeNode *  parent,
bool  expanded = true,
bool  isLeaf = false,
char **  pixmap_closed = NULL,
char **  pixmap_opened = NULL 
)

Add a node to <parent> tree.

Parameters
text,anarray of strings
parent,ifNULL add the node as a new root (same as adding a row to a VDKCustomList)
isLeaf,ifis a leaf or not
pixmap_closed,pixmapshowed when node is collapsed
pixmap_open,pixmapshowed when node is expanded

◆ Clear()

void VDKCustomTree::Clear ( )
virtual

Clear widget

Reimplemented from VDKCustom.

◆ Find()

VDKTreeNodeList * VDKCustomTree::Find ( char *  key)

Returns a list of nodes that match <key>. Returned list should be deleted by user or it will leak.

◆ IsExpanded()

bool VDKCustomTree::IsExpanded ( VDKTreeNode  node)

Returns true if <node> is expanded

Parameters
node

◆ IsLeaf()

bool VDKCustomTree::IsLeaf ( VDKTreeNode  node)

Returns true if <node> is a leaf

Parameters
node

◆ Key()

char * VDKCustomTree::Key ( VDKTreeNode  node)

Returns node key

Parameters
node

◆ operator[]()

Tuple VDKCustomTree::operator[] ( VDKTreeNode  node)

Returns a tuple of <node> node, an array containing all columns texts.

Parameters
node

◆ RemoveKey()

int VDKCustomTree::RemoveKey ( char *  key)

Removes all nodes with key==<key>, return number of removed nodes

◆ RemoveNode()

bool VDKCustomTree::RemoveNode ( VDKTreeNode  node)

Removes a node, return true on success

Parameters
node,nodeto be removed

◆ Selection()

VDKTreeNode VDKCustomTree::Selection ( )
inline

Returns selected node

◆ Selections()

VDKTreeNodeArray & VDKCustomTree::Selections ( )

Returns an array of selected nodes (valid on multiple and extended mode)

◆ Unselection()

VDKTreeNode VDKCustomTree::Unselection ( )
inline

Returns unselected node


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