SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TabbedPane.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_TABEED_PANE_H__
8 #define __SCV_TABEED_PANE_H__
9 
10 #include "Panel.h"
11 #include "Component.h"
12 #include "ComponentTexture.h"
13 
14 namespace scv {
15 
16 class TabbedPane : public Component {
17 public:
18  TabbedPane(const scv::Point &p1, const scv::Point &p2);
19 
20  virtual void onTabChange(void);
21 
22  //Memory Management
23  virtual void addChild(Component *object);
24  virtual void addChild(Component *object, const std::string &label, bool resize = true);
25 
26  virtual void removeChild(Component *object);
27 
28  void processMouse(const scv::MouseEvent &evt);
29  void processKey(const scv::KeyEvent &evt);
30 
31  void setCurrTabIndex(int index);
32  inline int getCurrTabIndex(void) const;
33 
34  inline scv::Component *getCurrComponent(void) const;
35 
36  void display(void);
37 
38 private:
39  void createTexture(void);
40  ComponentTexture* _cTexture;
41  void configPanel(void);
42 
43  static const int s_tabSpacing, s_barHeight;
44 
45  int _currecOverTab, _currSelectedTab;
46 
47  std::vector<int> _index;
48  std::vector<std::string> _labels;
49  std::vector<bool> _resize;
50 };
51 
53 
54 int TabbedPane::getCurrTabIndex(void) const {
55  return _currSelectedTab;
56 }
57 
59  if (_currSelectedTab != -1) {
60  return getChild(_currSelectedTab);
61  } else {
62  return NULL;
63  }
64 }
65 
66 } // namespace scv
67 
68 #endif // __SCV_TABEED_PANE_H__