#include <uwin.hpp>
Inheritance diagram for ubit::UWin:
Public Member Functions | |
UWin (const UArgs &=UArgs::none) | |
constructor; see class UWin. | |
virtual | ~UWin () |
recursive destructor. | |
virtual class UWin * | winCast () |
UWin & | addlist (const UArgs &a) |
adds a list of arguments to the end the child list. | |
virtual UWin & | setTitle (const UStr &, UDisp *=null) |
changes the title of the window. | |
virtual void | setPos (UMouseEvent &, float x=0, float y=0) |
moves the upper left corner of the window to the event location. | |
virtual void | setPos (const UWin &win, const UPoint &, UDisp *=null) |
moves the upper left corner of the window relatively to this position in 'win'. | |
virtual void | setPos (const UView &view, const UPoint &) |
moves the upper left corner of the window relatively to this position in 'view'. | |
virtual void | setPos (const UView &view, const UPlacement &) |
moves the window according to this UPlacement and relatively to 'view' . | |
virtual void | setPosOnScreen (const UPoint &, UDisp *=null) |
moves the upper left corner of the window to this position on the screen. | |
virtual void | centerOnScreen (UDisp *=null) |
virtual UPoint | getPos (const UWin &win, UDisp *=null) const |
returns the position of the upper left corner of the window relatively to 'win'. | |
virtual UPoint | getPos (const UView &view) const |
returns the position of the upper left corner of the window relatively to 'view'. | |
virtual UPoint | getPosOnScreen (UDisp *=null) const |
returns the position of the upper left corner of the window on the screen. | |
virtual float | getWidth (UDisp *=null) const |
returns the window width. | |
virtual float | getHeight (UDisp *=null) const |
returns the window height. | |
virtual UDimension | getSize (UDisp *=null) const |
returns the window size on this display. | |
virtual void | setSize (const UDimension &, UDisp *=null) |
changes the window size on this display. | |
virtual void | adjustSize () |
adjusts the size of the window according to its content. | |
virtual void | setFullScreen (bool state, UDisp *=null) |
set full screen mode on or off. | |
virtual void | toBack (UDisp *=null) |
sends this window to the back on this display. | |
virtual void | toFront (UDisp *=null) |
brings this window to the front on this display. | |
virtual bool | isShown () const |
returns true if this object is shown. | |
virtual bool | isShown (UDisp *) const |
is the window currently shown ? | |
virtual void | show (bool state, UDisp *) |
virtual void | show (bool state=true) |
shows/hides the window. | |
virtual bool | isModal () const |
is this dialog modal?. | |
virtual void | setModal (bool=true) |
sets this dialog in modal or non modal mode. | |
virtual int | showModal (UDisp *=null) |
shows a window in modal mode and returns its closing status. | |
virtual void | close (int status=0) |
closes the window. | |
virtual void | repaint () |
specifies that this object must be repainted. | |
virtual void | update () |
specifies that the layout and the paint of this object must be updated. | |
virtual void | update (const UUpdate &mode) |
specifies that the layout and/or the paint of this object must be updated. | |
virtual void | update (const UUpdate &, UDisp *) |
specifies that the layout and/or the paint of this window must be updated on this display. | |
bool | isHardWin () const |
bool | isSoftWin () const |
is this window a "hard window" or a "soft window" ?. | |
virtual UWin & | setSoftWin (bool=true) |
sets the "soft window" mode if arg is true. | |
virtual bool | realize () |
[impl] initializes the window and its children. | |
UNatWin * | getNatWin (UDisp *=null) const |
[impl] returns the Native Window that is used for drawing this window | |
UView * | getWinView (UDisp *) const |
[impl] returns the corresponding view. | |
virtual void | highlight (bool state) |
[impl]. | |
Static Public Member Functions | |
static UStyle * | createStyle () |
< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!). |
UWin is an abstract class for creating toplevel windows:
A UWin can be added as a child: of the UAppli; of a given UDisp (if the application is displayed on several machines); or of any UBox Note that, as other UBricks, windows can have several parents.
Layout: The size of windows is computed the first time they appear on the screen (this is typically done by calling UWin::show()). By default, the size won't change when children are added or removed. Hence, children should be added before the first call to show(). It can be changed afterward by calling adjustSize() or setSize() or through user interaction.
Implicit hehaviors: if a parent of a window is a UButton (or a subclass), clicking on this button will open the window automatically
ubit::UWin::~UWin | ( | ) | [virtual] |
recursive destructor.
children are automatically destroyed if not pointed elsewhere (in the instance graph or by a uptr<>). see class UBrick for details.
adds a list of arguments to the end the child list.
Exemple:
UBox* b = new UBox(); b->addlist( UColor::red + UFont::bold + "abcd" );
Reimplemented from ubit::UBox.
void ubit::UWin::adjustSize | ( | ) | [virtual] |
adjusts the size of the window according to its content.
By default, the size of a window does not change when children are added or removed. This function adjusts the size of a window to the size of its children
void ubit::UWin::close | ( | int | status = 0 |
) | [virtual] |
closes the window.
This function is called when the "Close" button of the window decoration is clicked. Its default behavior is to call show(false). It can be redefined by subclasses for more specific behaviors (eg. for saving data or for closing the application)
'status' is returned by showModal() if it was used to open the menu. `status' must be >= 0 (0 is the default value:
Reimplemented from ubit::UGroup.
Reimplemented in ubit::UFrame.
UStyle * ubit::UWin::createStyle | ( | ) | [static] |
< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).
this macro defines the UClass that corresponds to this class and:
Reimplemented from ubit::UBox.
Reimplemented in ubit::UCtlmenu, ubit::UMenu, ubit::UPopmenu, ubit::UPiemenu, ubit::UDialog, and ubit::UFrame.
bool ubit::UWin::isShown | ( | ) | const [virtual] |
returns true if this object is shown.
isShown() returns true if this object is "showable" (see isShowable()) and all its parents are also "showable". Note that "shown" objects are not always visible on the screen as they may be hidden or clipped by other objects such as scroll panes.
Reimplemented from ubit::UControl.
bool ubit::UWin::isSoftWin | ( | ) | const |
is this window a "hard window" or a "soft window" ?.
Notes:
bool ubit::UWin::realize | ( | ) | [virtual] |
[impl] initializes the window and its children.
this function called when the window is shown for the first time
Reimplemented in ubit::UMenu, ubit::UDialog, and ubit::UFrame.
virtual void ubit::UWin::repaint | ( | ) | [virtual] |
specifies that this object must be repainted.
note that actual painting is generally delayed (
Reimplemented from ubit::UBox.
void ubit::UWin::setPos | ( | UMouseEvent & | , | |
float | x = 0 , |
|||
float | y = 0 | |||
) | [virtual] |
moves the upper left corner of the window to the event location.
(x, y) are added to the event location.
void ubit::UWin::setPosOnScreen | ( | const UPoint & | , | |
UDisp * | = null | |||
) | [virtual] |
moves the upper left corner of the window to this position on the screen.
!!COMPLETER
UWin & ubit::UWin::setSoftWin | ( | bool | = true |
) | [virtual] |
sets the "soft window" mode if arg is true.
this mode can only be set *before* window initialization (ie. before the window is added to a visible object) see isSoftwin() for details.
virtual void ubit::UWin::show | ( | bool | state = true |
) | [virtual] |
shows/hides the window.
windows are not shown by default; show() must be called to make them visible. Note that the window size will not change after the first call to show(). setSize() or updateSize() must be called to change its size.
Reimplemented from ubit::UGroup.
Reimplemented in ubit::UMenu, ubit::UPiemenu, ubit::UDialog, and ubit::UFrame.
int ubit::UWin::showModal | ( | UDisp * | = null |
) | [virtual] |
shows a window in modal mode and returns its closing status.
showModal() returns when the window is closed (through user interaction or programmatically by calling close()). The returned value is :
specifies that the layout and/or the paint of this window must be updated on this display.
the specific actions that will take place depend on the UUpdate argument. Note that these actions are generally delayed:
void ubit::UWin::update | ( | const UUpdate & | mode | ) | [virtual] |
specifies that the layout and/or the paint of this object must be updated.
the specific actions that will take place depend on the UUpdate argument. Note that these actions are generally delayed:
Reimplemented from ubit::UBox.
virtual void ubit::UWin::update | ( | ) | [virtual] |
specifies that the layout and the paint of this object must be updated.
note that these actions are generally delayed (
Reimplemented from ubit::UBox.