ALBA
albaGUICheckTree.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUICheckTree
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaGUICheckTree_H__
17#define __albaGUICheckTree_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include "albaGUITree.h"
22#include "albaPics.h"
23#include <wx/imaglist.h>
24#include <wx/treectrl.h>
25#include <map>
26#ifdef ALBA_EXPORTS
27#include "albaDllMacros.h"
28EXPORT_STL_MAP(ALBA_EXPORT,wxString,int);
29#endif
30//----------------------------------------------------------------------------
31// Forward refs:
32//----------------------------------------------------------------------------
33class albaVME;
34class albaView;
35
36//----------------------------------------------------------------------------
37// albaGUICheckTree :
38//----------------------------------------------------------------------------
44class ALBA_EXPORT albaGUICheckTree: public albaGUITree
45{
46public:
48 albaGUICheckTree (wxWindow* parent, wxWindowID id=-1, bool CloseButton = false, bool HideTitle = false);
51
53 void VmeAdd(albaVME *vme);
54
56 void VmeRemove(albaVME *vme);
57
59 void VmeSelected(albaVME *vme);
60
62 albaVME *GetSelectedNode() {return m_SelectedVME;};
63
65 bool IsIconChecked(wxTreeItemId item);
66
68 void VmeShow(albaVME *vme, bool show);
69
71 void VmeModified(albaVME *vme);
72
75
77 void ViewDeleted(albaView *view);
78
79// todo:
80// setting m_enableSelect to false
81// doesn't prevent to change the selection using the keyboard !!
82//SIL. 7-4-2005:
83
85 void EnableSelect(bool enable);
86
88 wxTreeCtrl *GetTree() {return m_NodeTree;};
89
91 virtual bool IsVMEExpanded(albaVME *vme);
92
94 virtual void CollapseVME(albaVME *vme);
95
97 virtual void ExpandVME(albaVME *vme);
98protected:
101
104
106 virtual int GetVmeStatus(albaVME *vme);
107
109 int ClassNameToIcon(wxString classname);
110
113 virtual void InitializeImageList();
114
117 wxBitmap MergeIcons(wxBitmap state, wxBitmap vme);
118
119public:
121 void OnMouseDown(wxMouseEvent& event);
122
124 void OnMouseUp(wxMouseEvent& event);
125
127 void OnMouseEvent(wxMouseEvent& event);
128
130 virtual void OnIconClick(wxTreeItemId item);
131
133 virtual void ShowContextualMenu(wxMouseEvent& event);
134
136 virtual void OnSelectionChanged(wxTreeEvent& event);
137
138protected:
141 //bool m_CheckCrypto;
143 wxMenu *m_RMenu;
144
145 typedef std::map<wxString,int> MapClassNameToIcon;
147
149 DECLARE_EVENT_TABLE()
150}; // end of albaGUICheckTree
151#endif
#define EXPORT_STL_MAP(declspec_, K_, V_)
Definition: albaDllMacros.h:90
class Name : albaGUICheckTree.
std::map< wxString, int > MapClassNameToIcon
wxBitmap MergeIcons(wxBitmap state, wxBitmap vme)
Given two bitmaps, it creates a third bitmap.
void VmeAdd(albaVME *vme)
Add the vme to the checked tree and create the related icon.
void OnMouseUp(wxMouseEvent &event)
Called by the Custom-Tree-Event-Handler.
virtual void CollapseVME(albaVME *vme)
Collapse the VME on the Tree.
MapClassNameToIcon m_MapClassNameToIcon
void EnableSelect(bool enable)
Enable the selection of a node tree.
virtual void ExpandVME(albaVME *vme)
Expand the VME on the Tree
albaGUICheckTree(wxWindow *parent, wxWindowID id=-1, bool CloseButton=false, bool HideTitle=false)
constructor .
virtual void InitializeImageList()
Fill the image list considering the visibility vme type, and vme availability.
void VmeShow(albaVME *vme, bool show)
Update the vme node icon into the checked tree.
wxTreeCtrl * GetTree()
Retrieve wxwindows widget pointer of the tree.
virtual void OnSelectionChanged(wxTreeEvent &event)
respond to Selection Changed
void TreeUpdateIcon()
Update all the vme nodes icon.
virtual int GetVmeStatus(albaVME *vme)
Return the status of the node according to the vme visibility.
virtual void ShowContextualMenu(wxMouseEvent &event)
Called by the Custom-Tree-Event-Handler.
void OnMouseDown(wxMouseEvent &event)
Called by the Custom-Tree-Event-Handler.
void ViewDeleted(albaView *view)
Update the vme tree nodes when a view is deleted.
void VmeRemove(albaVME *vme)
Remove the vme from the checked tree.
virtual void OnIconClick(wxTreeItemId item)
Called by the Custom-Tree-Event-Handler - via OnMouseDown.
void OnMouseEvent(wxMouseEvent &event)
Called by the Custom-Tree-Event-Handler.
virtual bool IsVMEExpanded(albaVME *vme)
Return True if the VME is Expanded on Tree.
bool IsIconChecked(wxTreeItemId item)
Return true if the icon associated to the tree item is checked.
void VmeSelected(albaVME *vme)
Select the vme node of the checked tree.
void ViewSelected(albaView *view)
Update the vme tree nodes with the new vme visibility for the selected view.
virtual ~albaGUICheckTree()
destructor .
int ClassNameToIcon(wxString classname)
retrieve the icon-index for a vme given the classname
void VmeUpdateIcon(albaVME *vme)
Update the vme nodes icon.
albaVME * GetSelectedNode()
Return the current selected node.
void VmeModified(albaVME *vme)
Update the vme node label with the new vme name.
albaTreeCtrl * m_NodeTree
Definition: albaGUITree.h:250
albaVME -
Definition: albaVME.h:150
albaView is the base class for Views in alba.
Definition: albaView.h:79