Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UWin Class Reference

Generic Window: base class for windows and menus. More...

#include <uwin.hpp>

Inheritance diagram for UWin:

UDialog UIncrust UMenu UFrame UPopmenu List of all members.

Public Member Functions

 UWin (const UArgs &)
 constructor; see also class UGroup and destructor UGroup::~UGroup
virtual ~UWin ()
 important note on recursive deletion: see UGroup:~UGroup
virtual class UWinwinCast ()
virtual const UStylegetStyle (UContext *) const
virtual void move (UWin *, u_pos x_in_win, u_pos y_in_win, UDisp *=null)
 changes window location relatively to a (x,y) position in a Window.
virtual void move (class UView *, u_pos x_in_view, u_pos y_in_view)
 changes window location relatively to a (x,y) position in a View.
virtual void move (class UView *, class UPlacement &)
 changes window location relatively to a View using placement constraints ( UPlacement).
virtual void move (class UEvent *, u_pos x_offset, u_pos y_offset)
virtual void move (class UEvent &, u_pos x_offset, u_pos y_offset)
 changes window location relatively to an Event position.
virtual void moveOnScreen (u_pos x_in_screen, u_pos y_in_screen, UDisp *=null)
 changes window location on Screen.
virtual void moveAndCenter (UDisp *=null)
 centers the window on the screen.
virtual bool where (UWin *, u_pos &x, u_pos &y, UDisp *=null) const
 gets window location relatively to the origin of another Window.
virtual bool where (class UView *, u_pos &x, u_pos &y) const
 gets window location relatively to the origin of a View.
virtual bool whereOnScreen (u_pos &x, u_pos &y, UDisp *=null) const
 gets window location on Screen.
virtual void resize (u_dim width, u_dim height, UDisp *=null)
 changes current window size.
virtual bool getSize (u_dim &width, u_dim &height, UDisp *=null) const
virtual u_dim getWidth (UDisp *=null) const
virtual u_dim getHeight (UDisp *=null) const
 returns current size.
virtual void highlight (bool state)
virtual void close (int status=0)
 closes this window
virtual int lock (UDisp *=null)
 opens the window in modal mode and locks the execution thread
virtual void show (bool state, UDisp *)
virtual void show (bool state=true)
virtual bool isShown () const
 is the window currently shown ?
virtual void setModal (bool)
 sets this dialog in modal or non modal mode.
virtual bool isModal () const
 is this dialog modal?.
virtual void toBack ()
 sends this window to the back.
virtual void toFront ()
 brings this window to the front.
virtual void update ()
virtual void update (class UUpdate upmode)
virtual void update (class UUpdate upmode, UDisp *)
 updates this object's paint and/or layout
UViewgetWinViews () const
UViewgetWinView (class UDisp *) const
 returns the window View (UWins have only one (shared) view).
UAppligetAppli () const
 returns the Application Context of this window.
virtual void setSoftwinMode (bool=true)
 < returns the Display Context of this window.
UWinsoftwin ()
 sets the "soft window" mode if arg is true
bool isHardwin () const
bool isSoftwin () const
 is this window a "hard window" or a "soft window" ?
virtual bool realize ()=0
 [impl.] initializes the window and its children
UWinGraphgetWinGraph (class UDisp *=null) const
 [impl] returns the Graphics context that is used for drawing this window
UNatWin * getNatWin (class UDisp *=null) const
 [impl] returns the Native Window that is used for drawing this window

Static Public Member Functions

static const UStylemakeStyle ()

Static Public Attributes

static UStylestyle = null

Detailed Description

Generic Window: base class for windows and menus.

UWin is an abstract class:

Notes:


Member Function Documentation

void UWin::close int  status = 0  )  [virtual]
 

closes this window

Default behavior: hides the object (same as show(false)).

This function is called when the "Close" button of the window manager is clicked. It can be redefined by subclasses for appropriate behaviors (typically for saving or freeing data)

'status' should be >= 0 (0 being the default). see: UWin::lock() for details. close() is also called by UBox::closeWin() and by the ucloseWin() callback

Reimplemented in UMenu, and UFrame.

bool UWin::isShown  )  const [virtual]
 

is the window currently shown ?

show(true) also and brings the window to the front.

  • Note: by default, the window size won't change once the show() method has been called.
  • see also: class UWin, closeWin() and lock().

bool UWin::isSoftwin  )  const
 

is this window a "hard window" or a "soft window" ?

Notes:

  • a "hard window" has its own graphics context and (UNatWin) native window (= a native X Window counterpart)
  • a "soft window" simulates an actual window and uses the graphics context and native window of another hard window (typically the main frame of the application)
  • any window can either be a hard or soft window (except the main frame which must always be a hard window).

int UWin::lock UDisp = null  )  [virtual]
 

opens the window in modal mode and locks the execution thread

This function returns when the window is closed.

Returned value:

  • 0 when the window is closed by clicking on the "Close" button of the window manager
  • the value given as an argument to close()
  • this value should be >= 0 (typically the "Ok" button should call close(1) and the "Cancel" button close(0))

void UWin::moveOnScreen u_pos  x,
u_pos  y,
UDisp disp = null
[virtual]
 

changes window location on Screen.

!!COMPLETER

virtual bool UWin::realize  )  [pure virtual]
 

[impl.] initializes the window and its children

creates the associated graphics context and native window if this is a "hard window".

this fct. is automatically called when the window is shown for the first time (so that unused windows won't consume unnecessary resources)

Implemented in UMenu, UDialog, UFrame, and UIncrust.

UWin& UWin::softwin  ) 
 

sets the "soft window" mode if arg is true

see: isSoftwin() for details.

  • Warning: this mode can only be set *before* window initialization (ie. before the window is added to a visible object)

void UWin::update class UUpdate  upmode,
UDisp
[virtual]
 

updates this object's paint and/or layout

Arguments:

  • no argument: updates layout then repaints
  • upmode argument : updates according to this argument. see class UUpdate for details Note:
  • update() must be called after add() or remove() if their last argument was set to 'false'


The documentation for this class was generated from the following files:
Generated on Thu Mar 3 06:29:07 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.1