SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
InternalFrame.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_WINDOW_H__
8 #define __SCV_WINDOW_H__
9 
10 #include "Label.h"
11 
12 #include "Component.h"
13 #include "ComponentTexture.h"
14 #include "Panel.h"
15 
16 #include "Timer.h"
17 
18 namespace scv {
19 
20 class InternalFrameHolder;
21 
22 class InternalFrame : public Component {
23 friend class WindowHolder;
24 public:
25  InternalFrame(GLsizei width, GLsizei height, const std::string &title);
26 
27  virtual void onOpen(void);
28  virtual void onClose(void);
29 
30  virtual void setVisible(bool state);
31 
32  inline void setPanel(scv::Panel *panel);
33  inline scv::Panel *getPanel(void) const;
34 
35  Point getInternalSize() const;
36  void setInternalSize(GLsizei width, GLsizei height);
37 
38  inline void setTitle(const std::string &title);
39  inline std::string getTitle(void) const;
40 
41  void processMouse(const scv::MouseEvent &evt);
42  void processKey(const scv::KeyEvent &evt);
43 
44  void display(void);
45 
46 protected:
47  void createTexture(void);
49 
50  bool isOnTopBar(const scv::Point &p);
51  bool isOnCloseButton(const scv::Point &p);
52  void configPanel(void);
53 
54  static const int s_borderTop, s_borderWidth;
55  static const int s_closeWidth, s_closeHeight;
56 
57  std::string _title;
58 
62 };
63 
65 
67  if (_panel != NULL) {
69  }
70 
71  if (panel != NULL) {
72  _panel = panel;
74  }
75 }
76 
77 
79  return _panel;
80 }
81 
82 void InternalFrame::setTitle(const std::string &title) {
83  _title = title;
84 }
85 
86 std::string InternalFrame::getTitle(void) const {
87  return _title;
88 }
89 
90 } // namespace scv
91 
92 #endif // __SCV_WINDOW_H__