00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef INCLUDE_TREEVIEW_H
00024 #define INCLUDE_TREEVIEW_H
00025
00026 #include "control.h"
00027
00028 class TreeViewItem
00029 {
00030 public:
00031 MyString text;
00032 BOOL isCollaps;
00033 BOOL contentSub;
00034 BOOL askSubData;
00035 int idControl;
00036
00037 TreeViewItem()
00038 {
00039 isCollaps=TRUE;
00040 contentSub=FALSE;
00041 askSubData=FALSE;
00042 idControl=-1;
00043 }
00044 };
00045
00046 typedef MyTreeNode<TreeViewItem> TreeNode;
00047
00048 class EventTreeView
00049 {
00050 public:
00051 signal1<TreeNode *> select;
00052 };
00053
00059 class TreeView : public Control
00060 {
00061 private:
00062 int DrawRecursif(TreeNode *node,double margeY,int level);
00063 void AddTreeButton(Button *button,BOOL isCollaps);
00064 TreeNode * FindOnData(int idControl,TreeNode *node);
00065 double posY;
00066 void Test(Control *control);
00067 int OnClickPlus();
00068
00069 public:
00070 MyTree<TreeViewItem> data;
00071 EventTreeView onTreeView;
00072
00073 TreeView();
00074 void Create();
00075 void Draw ();
00076 TreeNode * FindOnData(int idControl);
00077 void GetTreePath(TreeNode *treeNode,MyString &result,BOOL isFirst=TRUE);
00078 void ConfigFacesPlus(Control *control,BOOL isCollaps);
00079
00080 int OnNextFrame(Timer *timer);
00081 int OnClick();
00082 };
00083
00084
00090 class TreeDirectory : public TreeView
00091 {
00092 private:
00093 void Loading(TreeNode *node,char *name,BOOL isCollaps);
00094
00095 BOOL addFile;
00096 BOOL addDirectory;
00097 MyString filter;
00098 MyString beginPath;
00099
00100 public:
00101 TreeDirectory();
00102 void Config(BOOL _addFile,BOOL _addDirectory,char *_filter=NULL);
00103 void Reset();
00104 void Loading(char *name,BOOL isCollaps=TRUE);
00105
00106 int OnClickDirectory(TreeNode *treeNode);
00107 };
00108
00109 #endif