16#ifndef __albaGUITree_H__
17#define __albaGUITree_H__
23#include <wx/imaglist.h>
24#include <wx/treectrl.h>
29#include "albaServiceClient.h"
30#include "albaAbsLogicManager.h"
99 albaGUITree (wxWindow* parent, wxWindowID
id=-1,
bool CloseButton =
false,
bool HideTitle =
false);
108 bool AddNode(
long long node_id,
long long parent_id , wxString label,
int icon = 0);
226 wxTreeItemId
GetItem() {
return m_TreeItemId;};
227 void SetItem(wxTreeItemId item){m_TreeItemId=item; };
Class Name: albaGUINamedPanel.
Data to be attached to an item of albaGUITree, holds the reference to a node_id.
albaGUITreeItemData(long long node_id)
specialized HashTable element used in albaGUITree to store a reference to a wxTreeItemId
wxTreeItemId m_TreeItemId
albaGUITreeTableElement(wxTreeItemId item)
void SetItem(wxTreeItemId item)
albaGUITree allows a simplified and lot easier use of a wxWindows tree widget.
bool DeleteNode(long long node_id)
Delete the specified node, and its subtree.
void SetListener(albaObserver *listener)
Set the Listener that will receive event-notification, the Listener can be changed any time
int GetNodeIcon(long long node_id)
Return the icon index for the node 'node_id'.
wxHashTable * m_NodeTable
void CollapseNode(long long node_id)
collapse the children of node_id
void SetImageList(wxImageList *img)
Set the images to be used for the nodes.
bool SetNodeLabel(long long node_id, wxString label)
Set the label for the node.
void Reset()
Clears all items in the tree.
bool SelectNode(long long node_id)
Select the node.
bool AddNode(long long node_id, long long parent_id, wxString label, int icon=0)
Create a new tree item with the specified parent,label and icon.
void SetNodeParent2(long long node_id, long long parent_id)
Move a node, and its subtree.
virtual void OnSelectionChanged(wxTreeEvent &event)
Private function that notify the Listener of node selection and deselection.
wxImageList * m_NodeImages
bool NodeHasChildren(long long node_id)
Check if the node has children.
void DeleteNode2(long long node_id)
Delete recursively a node and its subtree.
bool SetNodeParent(long long node_id, long long parent_id)
Move a node, and its subtree.
wxString GetNodeLabel(long long node_id)
Get the label for the node.
bool IsNodeExpanded(long long node_id)
void SetTreeStyle(long style)
long long NodeFromItem(wxTreeItemId &item)
Return node id from node item.
void ExpandNode(long long node_id)
expand the children of node_id
void OnSize(wxSizeEvent &event)
When tree is used on a wxNotebook m_NodeTree must be called on Sizing .
bool GetAutoSort()
Get the autosort flag.
void SortChildren(long long node_id=0)
Sort the children of node_id.
wxTreeItemId ItemFromNode(long long node_id)
Return the node item from node id.
bool NodeExist(long long node_id)
Return true if node exist.
int CheckIconId(int icon)
Check that id is a valid index in the imagelist - return the (eventually clamped) value.
long long GetNodeParent(long long node_id)
Return the parent id of the node.
bool SetNodeIcon(long long node_id, int icon)
Set the icon for the node.
albaGUITree(wxWindow *parent, wxWindowID id=-1, bool CloseButton=false, bool HideTitle=false)
albaObserver * m_Listener
void SetAutoSort(bool enable)
if autosort is on - the tree is always kept sorted
Interface implementing the Observer of the Subject/Observer design pattern.