CanvasCV: CanvasCV-doxygen/src/canvascv/widgets/selectionbox.h Source File
CanvasCV  1.0.0
selectionbox.h
1 #ifndef SELECTIONBOX_H
2 #define SELECTIONBOX_H
3 
4 #include <future>
5 #include "compoundwidget.h"
6 #include "vframe.h"
7 
8 namespace canvascv
9 {
10 
17 {
18 public:
19 
47  static std::shared_ptr<SelectionBox> create(Layout &layoutVal,
48  std::vector<std::string> selectionNames,
50  const cv::Point &pos = cv::Point(0,0));
51 
59  std::string getTextAt(int index) const;
60 
62  size_t size() const;
63 
65  void setUserCB(Widget::CBUserSelection cbUserSelection);
66 
67  virtual const char *getType() const;
68 
69  static const char *type;
70 
71 protected:
72  friend class WidgetFactory;
73  template <class T> friend class WidgetFactoryT;
74 
75  SelectionBox(const cv::Point &pos);
76 
77  void addButton(const std::string &txt);
78 
79  virtual void recalcCompound();
80 
81 private:
82  std::shared_ptr<VFrame> frame;
84 };
85 
86 }
87 
92 #endif // SELECTIONBOX_H
The WidgetFactory class.
Definition: widgetfactory.h:24
virtual void recalcCompound()
recalcCompound
The CompoundWidget class.
Definition: compoundwidget.h:18
void setUserCB(Widget::CBUserSelection cbUserSelection)
cbUserSelection will be invoked per user selection
The SelectionBox class.
Definition: selectionbox.h:16
std::function< void(Widget *, int)> CBUserSelection
signature of a callback which gets a user selection
Definition: widget.h:48
This namespace holds all the classes of the CanvasCV library.
Definition: canvas.h:20
virtual const char * getType() const
getType is always implemented by derived to return the same static pointer per widget.
The Layout class.
Definition: layout.h:17
static std::shared_ptr< SelectionBox > create(Layout &layoutVal, std::vector< std::string > selectionNames, Widget::CBUserSelection cbUserSelection=Widget::CBUserSelection(), const cv::Point &pos=cv::Point(0, 0))
create a selection box widget
std::string getTextAt(int index) const
getTextAt
The WidgetFactoryT class.
Definition: widgetfactory.h:58
size_t size() const
return nunmber of check boxes in group