Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

treeView.h

Go to the documentation of this file.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2003-2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006         
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
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

Generated on Fri Aug 20 19:19:51 2004 for 3d Controls by doxygen 1.3.6