SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ComponentSpring.h
Go to the documentation of this file.
1 #ifndef __SCV_COMPONENT_SPRING_H__
2 #define __SCV_COMPONENT_SPRING_H__
3 
4 #include "Spring.h"
5 
6 #include "Component.h"
7 
8 namespace scv {
9 
10 class ComponentSpring : public Spring {
11 public:
12  ComponentSpring(Component *component, int min, int pref, int max);
13 
14  virtual int calculateMinimumSize(Axis axis);
15  virtual int calculatePreferredSize(Axis axis);
16  virtual int calculateMaximumSize(Axis axis);
17 
18  virtual void setSize(Axis axis, int origin, int size);
19 
20  virtual int getSizeAlongAxis(Axis axis, Point size);
21 
22  inline void setComponent(Component *component);
23  inline Component *getComponent(void) const;
24 
25 protected:
26  inline bool isVisible(void) const;
27 
29 private:
30 };
31 
33 
34 bool ComponentSpring::isVisible(void) const {
35  return _component->isVisible();
36 }
37 
39  _component = component;
40 }
41 
43  return _component;
44 }
45 
46 } //namespace scv
47 
48 #endif //__SCV_COMPONENT_SPRING_H__