MeVisLab Scripting Reference
MLABWindowControl Class Reference

Inherits MLABWidgetControl.

Public Member Functions

virtual void setMinHeight (int s)
 
virtual void setMinWidth (int s)
 
Special methods for dialog access.
void accept ()
 
void reject ()
 
void done (int result)
 
int exec ()
 
Special methods for background images and borderless windows.
void setBackgroundImage (const QString &image, bool automask=false, bool resizeWindowToImage=false)
 
void setEnableMouseMoving (int button)
 
void startMouseMove ()
 
void stopMouseMove ()
 
void setMouseMoveField (MLABVector2Field *field)
 

Scripting access.

virtual void setTitle (const QString &title)
 
QString title ()
 
void setGeometry (QRect rect)
 
QRect geometry () const
 
void resize (const QSize &size)
 
void resize (int w, int h)
 
void setWidth (int w)
 
void setHeight (int h)
 
void resizeToMin ()
 
void resizeToHint ()
 
void resizeToPreferred ()
 
void updateFrame (bool minimum=false, bool center=false)
 
QRect screenGeometry () const
 
void show ()
 
void hide ()
 
void close ()
 
void setCloseAllowed (bool flag)
 
void center ()
 
void moveTo (MLABWidgetControl *w, int align, int xdistance, int ydistance)
 
void moveTo (MLABWidgetControl *w, int align)
 
void move (int x, int y)
 
void showNormal ()
 
void showFullscreen ()
 
void setCanGoFullscreen (bool flag)
 
bool canGoFullscreen ()
 
void showMinimized ()
 
bool isMinimized ()
 
void showMaximized ()
 
void raise ()
 
void raiseWindow ()
 

Additional Inherited Members

- Public Slots inherited from MLABWidgetControl
void adjustSize ()
 
virtual void setEnabled (bool flag)
 
virtual void setVisible (bool flag)
 
virtual bool isVisible ()
 
virtual void setFocus ()
 
virtual bool hasFocus ()
 
virtual void setToolTip (const QString &string)
 
virtual void setWhatsThis (const QString &string)
 
void displayWhatsThis ()
 
void displayWhatsThis (const QString &text)
 
QWidget * widget ()
 
QLayout * layout ()
 
virtual QString windowHandle ()
 
virtual bool createScreenshot (const QString &filename, bool grabFromScreen=true)
 
bool isReloadable () const
 
void reload (MLABTree *tree)
 
QString createGlobalScreenshot ()
 
QString applicationName ()
 
QSize size ()
 
int width ()
 
int height ()
 
int minWidth ()
 
int minHeight ()
 
int maxWidth ()
 
int maxHeight ()
 
void setMaxWidth (int s)
 
void setMaxHeight (int s)
 
QSize sizeHint ()
 
QSize minSize ()
 
QSize maxSize ()
 
void setMinSize (QSize size)
 
void setMaxSize (QSize size)
 
void updateLayout ()
 
int windowID ()
 
MLABWidgetControlcontrol (const QString &name)
 
float scaleFactor ()
 
MLABModulemodule ()
 
QString getType ()
 
QString getName ()
 
bool acceptDrops ()
 
void setAcceptDrops (bool flag)
 
void raiseWidget ()
 
void setStyleSheetFromString (const QString &styleSheetText)
 
void setStyleSheetFromFile (const QString &styleSheetFileName)
 
MLABTreetree ()
 
void updateMaxSize ()
 
bool expandX ()
 
bool expandY ()
 
MLABTreePtr getDefaultTagValues () const
 
virtual bool hasUncommittedChanges () const
 
virtual void applyUncommittedChanges ()
 
virtual void revertUncommittedChanges ()
 

Detailed Description

Window control.

This control shows a window.

Member Function Documentation

void MLABWindowControl::accept ( )

Accepts and closes the dialog (result 1).

bool MLABWindowControl::canGoFullscreen ( )
slot

Returns whether the window can go fullscreen (Mac OS X only currently).

void MLABWindowControl::center ( )
slot

Centers the window on the screen it's on.

void MLABWindowControl::close ( )
slot

Closes the window.

void MLABWindowControl::done ( int  result)

Closes the dialog and returns the result.

int MLABWindowControl::exec ( )

Show the dialog in a modal loop (when it was create with createModalDialog).

Returns the result given by accept(), reject(), or done(int).

QRect MLABWindowControl::geometry ( ) const
slot

Returns the geometry of the window.

void MLABWindowControl::hide ( )
slot

Hides the window.

bool MLABWindowControl::isMinimized ( )
slot

Returns whether the panel window is minimized.

void MLABWindowControl::move ( int  x,
int  y 
)
slot

Moves the window to the given position.

void MLABWindowControl::moveTo ( MLABWidgetControl w,
int  align,
int  xdistance,
int  ydistance 
)
slot

Moves to the given control and aligns this window relative to the given align position.

Available align flags (or'ed together) are, if not given centering is default:

  • MLAB.AlignLeft
  • MLAB.AlignRight
  • MLAB.AlignTop
  • MLAB.AlignBottom
void MLABWindowControl::raise ( )
slot

Raises this window to top of all windows.

void MLABWindowControl::raiseWindow ( )
inlineslot

Raises this window to top of all windows (this forwards to raise() but was necessary because "raise" is a reserved keyword in Python).

void MLABWindowControl::reject ( )

Rejects and closes the dialog (result 0).

void MLABWindowControl::resize ( const QSize &  size)
slot

Sets the size of the window.

void MLABWindowControl::resize ( int  w,
int  h 
)
slot

Sets a new size of the window.

void MLABWindowControl::resizeToHint ( )
slot

Resizes the window to the size hint, see also updateFrame().

void MLABWindowControl::resizeToMin ( )
slot

Resizes the window to the minimum size, see also updateFrame().

this call might require a

ctx.window().updateLayout()
ctx.window().resizeToMin()
void MLABWindowControl::resizeToPreferred ( )
slot

Resizes the window to the preferred size (taking into account pw and ph window tags if they are greater than the minimumSize).

QRect MLABWindowControl::screenGeometry ( ) const
slot

Returns the screen geometry of the screen this widget is on, see MLABDesktop for more methods on screens and geometries.

void MLABWindowControl::setBackgroundImage ( const QString &  image,
bool  automask = false,
bool  resizeWindowToImage = false 
)

Sets a background image for the window (which may also have a 0/255 alpha channel).

void MLABWindowControl::setCanGoFullscreen ( bool  flag)
slot

Enables/disables the button to go fullscreen (Mac OS X only currently).

void MLABWindowControl::setCloseAllowed ( bool  flag)
inlineslot

Sets whether the window can be closed (default is true).

void MLABWindowControl::setEnableMouseMoving ( int  button)

Enables mouse moving by clicking inside of the window and dragging.

Default is off, only recommended for borderless windows, button = -1 switches it off, 0 = left, 1 = middle, 2 = right button.

void MLABWindowControl::setGeometry ( QRect  rect)
slot

Sets the geometry of the window.

void MLABWindowControl::setHeight ( int  h)
slot

Sets the height of the window.

virtual void MLABWindowControl::setMinHeight ( int  s)
virtual

Sets the minimum height of the widget.

Reimplemented from MLABWidgetControl.

virtual void MLABWindowControl::setMinWidth ( int  s)
virtual

Sets the minimum width of the widget.

Reimplemented from MLABWidgetControl.

void MLABWindowControl::setMouseMoveField ( MLABVector2Field field)

Set a move field that is notified on changes of the moved window (x,y screen position).

virtual void MLABWindowControl::setTitle ( const QString &  title)
virtual

Sets the title of the window.

Reimplemented from MLABWidgetControl.

void MLABWindowControl::setWidth ( int  w)
slot

Sets the width of the window.

void MLABWindowControl::show ( )
slot

Shows the window.

void MLABWindowControl::showFullscreen ( )
slot

Shows the window fullscreen (with no menu bar decoration and quit buttons).

void MLABWindowControl::showMaximized ( )
slot

Shows the window maximized to fullscreen (with menu bar and close buttons).

void MLABWindowControl::showMinimized ( )
slot

Shows the window minimized, as an icon.

void MLABWindowControl::showNormal ( )
slot

Shows the window normally.

void MLABWindowControl::startMouseMove ( )

Starts the mouse move manually.

void MLABWindowControl::stopMouseMove ( )

Stops the mouse move manually.

QString MLABWindowControl::title ( )

Returns the current title caption (for window lists, etc.).

void MLABWindowControl::updateFrame ( bool  minimum = false,
bool  center = false 
)
slot

Updates window size and position, guarantees that the layout is updated correctly.

Parameters
minimumresizes to minimum size, otherwise to size hint
centeralso centers the window

This method updates the layout, processes the Qt events and then resizes the window. If center is set to true, the window is hidden, resized, centered, and shown again to avoid flickering.