00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _ubox_hpp_
00026 #define _ubox_hpp_
00027
00028 #include <ubit/ugroup.hpp>
00029
00030
00108 class UBox: public UGroup {
00109 public:
00110 static UStyle *style;
00111
00112 UBox(const UArgs& a = UArgs::none);
00117 friend UBox& ubox(const UArgs& a = UArgs::none) {return *new UBox(a);}
00123 virtual ~UBox() {destructs();}
00125
00126 virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00127 static const UStyle& makeStyle();
00128
00129
00130
00131
00132 UBox& addlist(const UArgs& a) {UGroup::addlist(a); return *this;}
00133
00134 virtual void update();
00135 virtual void update(UUpdate upmode);
00136
00137
00138
00139
00140 virtual UView* getView(int no) const;
00141 virtual int getViewCount() const;
00142 virtual UView** getViews() const;
00143 virtual UView** getViews(int &view_count) const;
00144 virtual int getViews(std::vector<UView*>&) const;
00150 UView* getViewContaining(UEvent&) const;
00152
00153 UView* getViewContaining(UView* child_view) const;
00155
00156 UView* getFirstViewInside(UView* parent_view) const;
00165
00166
00167
00168 virtual UBox& onPostChildEvent(const UArgs&);
00191
00192
00193
00194 #ifndef NO_DOC
00195 public:
00196 friend class UWin;
00197
00198 virtual class UBox* boxCast() {return this;}
00199 virtual ULink* makeLink();
00200
00201 virtual void initView(ULink *selflink, UView *ancestor_view);
00202 virtual void initChildViews(UGroup*, ULink *childlink);
00203 virtual void deleteRelatedViews(class UView* parview, class ULink*);
00204
00205
00206 virtual void updateView(UEvent&, UView*, const UUpdate&);
00207 static void updateImpl(const class UUpdate& upmode,
00208 UView* winview, UView* layoutview, UView* showview,
00209 bool impose_size, u_dim w, u_dim h);
00210 #endif
00211 };
00212
00213
00214
00215
00219 class UVbox: public UBox {
00220 public:
00221 static UStyle *style;
00222
00223 UVbox(const UArgs& a = UArgs::none) : UBox(a) {}
00225
00226 friend UVbox& uvbox(const UArgs& a = UArgs::none) {return *new UVbox(a);}
00228
00229 virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00230 static const UStyle& makeStyle();
00231 };
00232
00233
00234
00235
00239 class UHbox: public UBox {
00240 public:
00241 static UStyle *style;
00242
00243 UHbox(const UArgs& a = UArgs::none) : UBox(a) {}
00245
00246 friend UHbox& uhbox(const UArgs& a = UArgs::none) {return *new UHbox(a);}
00248
00249 virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00250 static const UStyle& makeStyle();
00251 };
00252
00253
00254
00255
00265 class UBar: public UBox {
00266 public:
00267 static UStyle *style;
00268
00269 UBar(const UArgs& a = UArgs::none): UBox(a) {}
00271
00272 friend UBar& ubar(const UArgs& a = UArgs::none) {return *new UBar(a);}
00274
00275 virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00276 static const UStyle& makeStyle();
00277 };
00278
00279
00280
00281
00297 class UFlowbox: public UBox {
00298 public:
00299 static UStyle *style;
00300
00301 UFlowbox(const UArgs& a = UArgs::none);
00302
00303 friend UFlowbox& uflowbox(const UArgs& a = UArgs::none)
00304 {return *(new UFlowbox(a));}
00305
00306 virtual const UStyle& getStyle(UContext*) const {return makeStyle();}
00307 static const UStyle& makeStyle();
00308 };
00309
00310 #endif
00311
00312