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
90protected:
93
96
98 virtual int GetVmeStatus(albaVME *vme);
99
101 int ClassNameToIcon(wxString classname);
102
105 virtual void InitializeImageList();
106
109 wxBitmap MergeIcons(wxBitmap state, wxBitmap vme);
110
111public:
113 void OnMouseDown(wxMouseEvent& event);
114
116 void OnMouseUp(wxMouseEvent& event);
117
119 void OnMouseEvent(wxMouseEvent& event);
120
122 virtual void OnIconClick(wxTreeItemId item);
123
125 virtual void ShowContextualMenu(wxMouseEvent& event);
126
128 virtual void OnSelectionChanged(wxTreeEvent& event);
129
130protected:
133 //bool m_CheckCrypto;
135 wxMenu *m_RMenu;
136
137 typedef std::map<wxString,int> MapClassNameToIcon;
139
141 DECLARE_EVENT_TABLE()
142}; // end of albaGUICheckTree
143#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.
MapClassNameToIcon m_MapClassNameToIcon
void EnableSelect(bool enable)
Enable the selection of a node 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.
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.
albaGUITree allows a simplified and lot easier use of a wxWindows tree widget.
Definition: albaGUITree.h:97
wxTreeCtrl * m_NodeTree
Definition: albaGUITree.h:202
albaVME -
Definition: albaVME.h:150
albaView is the base class for Views in alba.
Definition: albaView.h:79