00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00016
00017 #ifndef GUITREE_H
00018 #define GUITREE_H
00019
00020 #include <Midad/Gui/GuiBase.h>
00021 #include <TGListTree.h>
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,19,01)
00032 class GuiTreeEntry : public TGListTreeItemStd {
00033 #else
00034 class GuiTreeEntry : public TGListTreeItem {
00035 #endif
00036
00037
00038 public:
00039
00040 SigC::Signal0<void> clicked, on_mouse_over;
00041
00042 ~GuiTreeEntry();
00043
00044 private:
00045 friend class GuiTree;
00046 GuiTreeEntry(TGClient* client, const char* name,
00047 const TGPicture* opened,const TGPicture* closed);
00048
00049 };
00050
00051 class GuiTree : public TGListTree, public GuiBase
00052 {
00053
00054 public:
00055
00056 GuiTree(TGWindow& parent, UInt_t options = kHorizontalFrame);
00057 virtual ~GuiTree();
00058
00059
00060 GuiTreeEntry* AddEntry(GuiTreeEntry* parent, const char* label);
00061
00062
00063
00064
00065
00066 virtual void Clicked(TGListTreeItem* item, Int_t btn);
00067 virtual void DoubleClicked(TGListTreeItem* item, Int_t btn);
00068 virtual void OnMouseOver(TGListTreeItem* entry);
00069
00070 void DeleteAllItems();
00071
00072 private:
00073
00074
00075 GuiTree(const GuiTree& rhs);
00076 GuiTree& operator=(const GuiTree& rhs);
00077
00078
00079
00080 TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string,
00081 const TGPicture* open = 0,
00082 const TGPicture* closed = 0);
00083 TGListTreeItem* AddItem(TGListTreeItem* parent, const char* string,
00084 void* userData, const TGPicture* open = 0,
00085 const TGPicture* closed = 0);
00086
00087
00088 void OnMouseOver(TGFrame*) {}
00089 void Clicked(TGListTreeItem*, int, int, int) {}
00090 void Clicked(TGFrame*, int, int, int) {}
00091 void Clicked(TGFrame*, int) {}
00092 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,19,01)
00093 void Clicked(TGListTreeItem *, Int_t, UInt_t, Int_t, Int_t) {}
00094 #endif
00095 void DoubleClicked(TGListTreeItem*, int, int, int) {}
00096 void DoubleClicked(TGFrame*, int, int, int) {}
00097 void DoubleClicked(TGFrame*, int) {}
00098 };
00099
00100 #endif // GUITREE_H