FDOSTUI
FreeDOS Text User Interface
treeitem.hpp
Go to the documentation of this file.
1 /*
2  TREEITEM.H
3 
4  License CC0 PUBLIC DOMAIN
5 
6  To the extent possible under law, Mark J. Olesen has waived all copyright
7  and related or neighboring rights to FDOSTUI Library. This work is published
8  from: United States.
9 */
10 #ifndef __treeitem_hpp__
11 
12 #include "array.h"
13 #include "box.h"
14 
15 class treeitem
16 {
17 
18 public:
19 
20  treeitem(
21  unsigned char const* i_str,
22  void *const io_user_data= 0);
23 
24  bool
25  add(
26  unsigned char const* i_str,
27  void *const io_user_data= 0);
28 
29  bool
30  add(
31  treeitem*const io_item);
32 
33  treeitem*const
34  next() const;
35 
36  treeitem*const
37  prev() const;
38 
39  static void
40  set_links(
41  treeitem*const io_item,
42  treeitem*const io_parent,
43  treeitem*const io_prev,
44  unsigned int const i_level);
45 
46  virtual
47  ~treeitem();
48 
49 protected:
50 
51  unsigned int m_open:1;
52  unsigned char* m_text;
53  unsigned int m_len;
54  int m_pos_y;
55  void* m_user_data;
56  struct array m_child;
60  unsigned int m_level;
61 
62 private:
63 
64  friend class tree;
65 
66  treeitem();
67 
68  treeitem(
69  const treeitem&);
70 
71  treeitem&
72  operator=(treeitem const&);
73 
74 };
75 
76 #define __treeitem_hpp__
77 #endif
treeitem * m_parent
Definition: treeitem.hpp:57
static void set_links(treeitem *const io_item, treeitem *const io_parent, treeitem *const io_prev, unsigned int const i_level)
sets linkage between tree items
Definition: treeitem.cpp:236
unsigned char * m_text
Definition: treeitem.hpp:52
virtual ~treeitem()
destructor
Definition: treeitem.cpp:44
unsigned int m_level
Definition: treeitem.hpp:60
struct array m_child
Definition: treeitem.hpp:56
treeitem * m_next
Definition: treeitem.hpp:58
A dynamic array that holds pointers to objects.
treeitem *const prev() const
returns the previous item
Definition: treeitem.cpp:200
unsigned int m_len
Definition: treeitem.hpp:53
a rectanglular region
bool add(unsigned char const *i_str, void *const io_user_data=0)
add a child item to the tree
Definition: treeitem.cpp:69
int m_pos_y
Definition: treeitem.hpp:54
container to hold objects
Definition: array.h:14
treeitem * m_prev
Definition: treeitem.hpp:59
unsigned int m_open
Definition: treeitem.hpp:51
treeitem *const next() const
returns the next item
Definition: treeitem.cpp:141
void * m_user_data
Definition: treeitem.hpp:55
treeitem widget class
Definition: treeitem.hpp:15
tree widget class
Definition: tree.hpp:15