Image Component Library (ICL)
GUIComponentWithOutput.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/GUIComponentWithOutput.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLQt/GUIComponent.h>
35 
36 namespace icl{
37  namespace qt{
38 
40  GUIComponentWithOutput(const std::string &type, const std::string &params):
41  GUIComponent(type,params){}
42 
44  const GUIComponentWithOutput &handle(const std::string &handle) const{
46  return *this;
47  }
48 
50  const GUIComponentWithOutput &label(const std::string &label) const{
52  return *this;
53  }
54 
56  const GUIComponentWithOutput &tooltip(const std::string &tooltip) const{
58  return *this;
59  }
60 
64  return *this;
65  }
66 
68  const GUIComponentWithOutput &size(int w, int h) const {
69  return size(utils::Size(w,h));
70  }
71 
75  return *this;
76  }
77 
79  const GUIComponentWithOutput &minSize(int w, int h) const {
80  return minSize(utils::Size(w,h));
81  }
82 
86  return *this;
87  }
88 
90  const GUIComponentWithOutput &maxSize(int w, int h) const {
91  return maxSize(utils::Size(w,h));
92  }
93 
95 
96  const GUIComponentWithOutput &hideIf(bool flag) const{
97  if(flag) m_options.hide = true;
98  return *this;
99  }
100 
102  const GUIComponentWithOutput &out(const std::string &name) const {
103  m_options.out = name;
104  return *this;
105  }
106 
110  return *this;
111  }
112 
116  return *this;
117  }
118 
122  return *this;
123  }
124 
127  m_options.size = size;
128  return *this;
129  }
130 
132  GUIComponentWithOutput &size(int w, int h) {
133  m_options.size = utils::Size(w,h);
134  return *this;
135  }
136 
140  return *this;
141  }
142 
146  return *this;
147  }
148 
152  return *this;
153  }
154 
158  return *this;
159  }
160 
162 
164  if(flag) m_options.hide = true;
165  return *this;
166  }
167 
169  GUIComponentWithOutput &out(const std::string &name){
170  m_options.out = name;
171  return *this;
172  }
173 
174  };
175 
176  } // namespace qt
177 }
GUIComponentWithOutput & handle(std::string &handle)
sets the component handle
Definition: GUIComponentWithOutput.h:108
const GUIComponentWithOutput & size(int w, int h) const
sets the component initial size
Definition: GUIComponentWithOutput.h:68
GUIComponentWithOutput(const std::string &type, const std::string &params)
Definition: GUIComponentWithOutput.h:40
undocument this line if you encounter any issues!
Definition: Any.h:37
utils::Size size
intial size of the component (in units of 20px)
Definition: GUIComponent.h:65
const GUIComponentWithOutput & out(const std::string &name) const
sets the component output id
Definition: GUIComponentWithOutput.h:102
const GUIComponentWithOutput & size(const utils::Size &size) const
sets the component initial size
Definition: GUIComponentWithOutput.h:62
Definition: GUIComponentWithOutput.h:39
std::string label
label (results in a titeld border
Definition: GUIComponent.h:59
const GUIComponentWithOutput & hideIf(bool flag) const
hides the component if the given flag is true
Definition: GUIComponentWithOutput.h:96
std::string tooltip
component tooltip (not for containers)
Definition: GUIComponent.h:60
const GUIComponentWithOutput & tooltip(const std::string &tooltip) const
sets the component tooltip
Definition: GUIComponentWithOutput.h:56
GUIComponentWithOutput & out(const std::string &name)
sets the component output id
Definition: GUIComponentWithOutput.h:169
const GUIComponentWithOutput & label(const std::string &label) const
sets the component label
Definition: GUIComponentWithOutput.h:50
GUIComponentWithOutput & size(int w, int h)
sets the component initial size
Definition: GUIComponentWithOutput.h:132
Size class of the ICL.
Definition: Size.h:61
const GUIComponentWithOutput & minSize(int w, int h) const
sets the component minimum size constraint
Definition: GUIComponentWithOutput.h:79
utils::Size minSize
minimum size constraint of the component (in units of 20px)
Definition: GUIComponent.h:63
The GUIComponent class servers as a generic interface for GUI definitions.
Definition: GUIComponent.h:44
utils::Size maxSize
maximum size constraint of the component (in units of 20px)
Definition: GUIComponent.h:64
GUIComponentWithOutput & tooltip(std::string &tooltip)
sets the component tooltip
Definition: GUIComponentWithOutput.h:120
bool hide
if true, the component is not created at all
Definition: GUIComponent.h:66
GUIComponentWithOutput & hideIf(bool flag)
hides the component if the given flag is true
Definition: GUIComponentWithOutput.h:163
GUIComponentWithOutput & minSize(int w, int h)
sets the component minimum size constraint
Definition: GUIComponentWithOutput.h:144
Options m_options
all component options (mutable for C++-reasons)
Definition: GUIComponent.h:71
GUIComponentWithOutput & size(utils::Size &size)
sets the component initial size
Definition: GUIComponentWithOutput.h:126
GUIComponentWithOutput & label(std::string &label)
sets the component label
Definition: GUIComponentWithOutput.h:114
const GUIComponentWithOutput & minSize(const utils::Size &minSize) const
sets the component minimum size constraint
Definition: GUIComponentWithOutput.h:73
std::string handle
the component handle
Definition: GUIComponent.h:56
GUIComponentWithOutput & minSize(utils::Size &minSize)
sets the component minimum size constraint
Definition: GUIComponentWithOutput.h:138
const GUIComponentWithOutput & maxSize(const utils::Size &maxSize) const
sets the component maximum size constraint
Definition: GUIComponentWithOutput.h:84
GUIComponentWithOutput & maxSize(utils::Size &maxSize)
sets the component maximum size constraint
Definition: GUIComponentWithOutput.h:150
std::string out
the component output (only GUIComponentWithOutput subclasses)
Definition: GUIComponent.h:57
const GUIComponentWithOutput & maxSize(int w, int h) const
sets the component maximum size constraint
Definition: GUIComponentWithOutput.h:90
GUIComponentWithOutput & maxSize(int w, int h)
sets the component maximum size constraint
Definition: GUIComponentWithOutput.h:156
const GUIComponentWithOutput & handle(const std::string &handle) const
sets the component handle
Definition: GUIComponentWithOutput.h:44