65 GBox(GString
const& css_and_title =
"");
68 GBox* toBox()
override {
return this;}
69 GBox const* toBox()
const override {
return this;}
79 InContent = 1<<0, InBorder = 1<<1, Internals = 1<<2
90 T*
findChild(
bool in_border =
false)
const {
91 return dynamic_cast<T*
>(
findChild(T::Type(), in_border));
103 Gadget& operator[](
int index)
const;
114 int borderPos(
Gadget& child)
const;
124 GPredicate
const& = {});
125 virtual Gadget* childAtWPoint(
GPoint const& wpoint,
bool indirect =
false,
126 GPredicate
const& pred = {});
138 const GadgetList&
children()
const {
return children_;}
150 virtual bool contain(
Gadget* child,
bool indirect =
false)
const;
159 virtual void perform(std::function<
void(
Gadget& child)> fun);
165 virtual void perform(std::function<
void(
Gadget& child,
int index)> fun);
183 virtual void add(
Gadget* child,
int index = -1);
187 virtual bool borderAdd(
Gadget* child,
Place place);
188 virtual bool borderAdd(
Gadget& child,
Place place) {
return borderAdd(&child,place);}
197 void add(GString
const& item)
override;
198 void add(GString
const& item,
int index);
199 void add(GStrings
const& itemlist);
208 virtual bool remove(
Gadget* child);
225 enum struct ChoiceBehavior : uint8_t {
226 NoChoice=0, Select=1, Show=2
230 ChoiceBehavior
choiceBehavior()
const {
return ChoiceBehavior(modes_.choiceBehavior);}
232 void setValue(GString
const&)
override;
235 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
239 static GType& Type();
240 GType& type()
const override {
return Type();}
245 virtual void topInit();
246 virtual void initChildren(GRender* parrender);
247 void initClone(
Gadget& from, GClone
const&)
override;
248 void addProp(GProp&,
bool add_to_proplist)
override;
249 virtual void addItem(
class GItemSpec
const& item);
250 Gadget* addItemImpl(GString
const& item,
int index, GString& defclass);
251 virtual Gadget& createDefaultItem(GString
const& arg);
252 virtual void setChoiceImpl(GChoice& c,
bool add_to_list);
254 virtual GDim computeInsideSize(GRender&);
255 virtual void computeInsideSizeColumn(GDim& boxsize, GRender&);
256 virtual void computeInsideSizeRow(GDim& boxsize, GRender&);
257 virtual void computeInsideSizeStack(GDim& boxsize, GRender&);
258 GRect childrenArea(GRender&)
const;
260 void pack(GRender* parent_render)
override;
261 virtual void packColumn(GRect& ch_area, GRender&);
262 virtual void packRow(GRect& ch_area, GRender&);
263 virtual void packPie(GRect& ch_area, GRender&);
264 virtual void packStack(GRect& ch_area, GRender&);
265 virtual void packBorders(GRect& ch_area, GRender&);
266 void moveImpl(
float winx,
float winy,
bool callcb)
override;
269 BorderChild(
Gadget* c,
Place p) : child_(c), place_(p) {}
273 using BorderList = std::vector<BorderChild>;
274 GadgetList children_;
275 BorderList* bchildren_{};
288 GHBox(GString
const& css_and_title =
"") :
GBox(Type(), css_and_title) {}
291 static GType& Type();
292 GType& type()
const override {
return Type();}
299 GPane(GString
const& css_and_title =
"") :
GBox(Type(), css_and_title) {}
302 static GType& Type();
303 GType& type()
const override {
return Type();}
310 GBox& Box(GString
const& css_and_title =
"");
311 GVBox& VBox(GString
const& css_and_title =
"");
312 GHBox& HBox(GString
const& css_and_title =
"");
313 GPane& Pane(GString
const& css_and_title =
"");
332 GButtonBox(GString
const& css_and_title =
"");
334 Gadget& createDefaultItem(GString
const& arg)
override;
337 static GType& Type();
338 GType& type()
const override {
return Type();}
341 GButtonBox& ButtonBox(GString
const& css_and_title =
"");