SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GenericTree.h
Go to the documentation of this file.
1 
7 #ifndef _SCV_GENERIC_TREE_H_
8 #define _SCV_GENERIC_TREE_H_
9 
10 #include "GenericNode.h"
11 #include "Component.h"
12 #include "ComponentTexture.h"
13 
14 namespace scv {
15 
20 struct GenericNodeDisplay;
21 
22 class GenericTree : public Component
23 {
24 public:
26  virtual ~GenericTree(void);
27 
30  void refreshDisplay();
31 
32  virtual void onItemSelected(void);
33 
34  virtual void processMouse(const scv::MouseEvent &evt);
35  virtual void processKey(const scv::KeyEvent &evt);
36 
37  virtual void display(void);
38 
39 private:
40  GenericNode* findSelected(GenericNode*, int, int espacos);
41  virtual void createTexture(void);
42  ComponentTexture* _cTexture;
43 
44  static const int s_lineSpacing = 12;
45  static const int s_borderWidth = 4;
46  static const int s_borderHeight = 3;
47  static const int s_imageSpace = 26;
48 
49  int m_selectStart, m_selectEnd;
50  int m_firstLine, m_nLines, spaceBack;
51 
52  GenericNode* _nodeSelected;
53  GenericNode* _nodeRoot;
54  int _jumpOnFindSelected;
55  std::vector<GenericNodeDisplay> _nodesDisplay;
56 };
57 
59  return _nodeSelected;
60 }
61 
66  return _nodeRoot;
67 }
68 
69 } //namespace scv
70 
71 #endif