CanvasCV: CanvasCV-doxygen/src/canvascv/widgets/horizontallayout.h Source File
CanvasCV  1.0.0
horizontallayout.h
1 #ifndef HORIZONTALLAYOUT_H
2 #define HORIZONTALLAYOUT_H
3 
4 #include "autolayout.h"
5 
6 namespace canvascv
7 {
8 
38 {
39 public:
40 
48  static std::shared_ptr<HorizontalLayout> create(Layout &layout,
49  const cv::Point &pos = cv::Point(0,0));
50 
51  virtual const char *getType() const;
52 
54  int getSpacing() const;
55 
57  void setSpacing(int value);
58 
59  static const char *type;
60 
61 protected:
62  friend class WidgetFactory;
63  template <class T> friend class WidgetFactoryT;
64 
65  HorizontalLayout(const cv::Point &pos);
66 
67  virtual void recalcCompound();
68 
69  /* TODO - write/read widgets to file for a designer app
70  virtual void writeInternals(FileStorage &fs) const;
71  virtual void readInternals(const FileNode &node);
72  */
73 
74 private:
75 
76  int spacing;
77 };
78 
79 }
80 
81 #endif // HORIZONTALLAYOUT_H
The WidgetFactory class.
Definition: widgetfactory.h:24
virtual const char * getType() const
getType is always implemented by derived to return the same static pointer per widget.
static std::shared_ptr< HorizontalLayout > create(Layout &layout, const cv::Point &pos=cv::Point(0, 0))
create a HorizontalLayout widget
void setSpacing(int value)
sets pixel spacing between items
The AutoLayout class.
Definition: autolayout.h:15
This namespace holds all the classes of the CanvasCV library.
Definition: canvas.h:20
int getSpacing() const
returns pixel spacing between items
The HorizontalLayout class.
Definition: horizontallayout.h:37
The Layout class.
Definition: layout.h:17
virtual void recalcCompound()
recalcCompound
The WidgetFactoryT class.
Definition: widgetfactory.h:58