ubit
upalette.hpp
1 /************************************************************************
2  *
3  * upalette.hpp: movable palette box (internal frame)
4  * Ubit GUI Toolkit - Version 6
5  * (C) 2009 | Eric Lecolinet | TELECOM ParisTech | http://www.enst.fr/~elc/ubit
6  *
7  * ***********************************************************************
8  * COPYRIGHT NOTICE :
9  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15  * ***********************************************************************/
16 
17 #ifndef _upalette_hpp_
18 #define _upalette_hpp_ 1
19 #include <ubit/ubox.hpp>
20 namespace ubit {
21 
24  class UPalette : public UBox {
25  public:
26  UCLASS(UPalette)
27  static UStyle* createStyle();
28 
29  UPalette(UArgs content_args = UArgs::none);
30 
31  UBox& content() {return *pcontent;}
33 
34  UElem& title() {return *ptitle;}
36 
37  UElem& controls() {return *pcontrols;}
39 
40  UBox& titleBar() {return *ptitle_bar;}
42 
43  UBox& resizeBtn() {return *presize_btn;}
45 
46  UPos& pos() {return *ppos;}
47  USize& size() {return *psize;}
48  UScale& contentScale() {return *pcontent_scale;}
49 
50  void setPosModel(UPos*);
51  void setPosControlModel(UPosControl*);
52 
53  protected:
54  uptr<UPos> ppos;
55  uptr<UPosControl> ppos_ctrl;
56  uptr<USize> psize;
57  uptr<USizeControl> psize_ctrl;
58  uptr<UScale> pcontent_scale;
59  uptr<UBox> pcontent;
60  uptr<UElem> ptitle;
61  uptr<UElem> pcontrols;
62  uptr<UBox> ptitle_bar;
63  uptr<UBox> presize_btn;
64  };
65 
66  inline UPalette& upalette(UArgs content = UArgs::none) {return *new UPalette(content);}
68 
69 }
70 #endif
UBox & resizeBtn()
returns the resize button (not show by default, resizeBtn().show() to make it appear).
Definition: upalette.hpp:43
UElem & controls()
returns the controls area (located in the right hand part of the titlebar()).
Definition: upalette.hpp:37
Widget position.
Definition: uboxgeom.hpp:91
Box container.
Definition: ubox.hpp:64
UElem & title()
returns the title (located in the left hand part of the titlebar()).
Definition: upalette.hpp:34
lightweight general purpose container.
Definition: uelem.hpp:44
Smart Pointer for UObject instances (.
Definition: uobject.hpp:365
Argument list (for passing arguments to constructor or add functions).
Definition: uargs.hpp:43
UBox & titleBar()
returns the title bar (which includes a title() and a controls() area).
Definition: upalette.hpp:40
Position Control: interactive control of the position of a widget.
Definition: uboxgeom.hpp:162
movable palette box (internal frame).
Definition: upalette.hpp:24
Definition: uhardfont.hpp:31
static const UArgs none
the empty arglist.
Definition: uargs.hpp:45
UBox & content()
returns the content (the working area of the palette).
Definition: upalette.hpp:31
Widget scale.
Definition: uboxgeom.hpp:31
Widget Size.
Definition: uboxgeom.hpp:228
Compiled Object Style.
Definition: ustyle.hpp:44