Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

QWindow Class Reference

Widget which is a GUI-Window. More...

#include <QWindow.h>

Inheritance diagram for QWindow:

Inheritance graph
[legend]
Collaboration diagram for QWindow:

Collaboration graph
[legend]

Public Methods

virtual void drawFrame ()
 draws frame

void drawCoordInfos (int x, int y, const char *Text)
 draws info about size/position. Semi transparent rectangle with window font

void drawCloseButton ()
 draws close button

void drawMaximizeButton ()
 draws maximize button

void maximize ()
 maximize / restore window. If window is maximized, restore its size/position, else maximize its size

virtual void draw (QEvent *e)
 draws itself with OpenGL. Here is the OpenGL drawing code

virtual void layout ()
 layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes

virtual bool canDrag (QEvent *e)
 have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged

virtual bool processEvent (QEvent *e)
 processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner

virtual bool processMouseOwner (QEvent *e)
 processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner

virtual void childrenChanged ()
 called if a child is added/removed

virtual bool canFocus (QEvent *e)
 defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus

virtual void Init ()
 initialization code

virtual void CleanUp ()
 clean up code

virtual int getTitleBarHeight ()
 getter method for TitleBarHeight

virtual void setTitleBarHeight (int newValue)
 setter method for TitleBarHeight

virtual int getTitleBarBorder ()
 getter method for TitleBarBorder

virtual void setTitleBarBorder (int newValue)
 setter method for TitleBarBorder

virtual string getCaption ()
 getter method for Caption

virtual void setCaption (string newValue)
 setter method for Caption

virtual int getMinResizeWidth ()
 getter method for MinResizeWidth

virtual void setMinResizeWidth (int newValue)
 setter method for MinResizeWidth

virtual int getMinResizeHeight ()
 getter method for MinResizeHeight

virtual void setMinResizeHeight (int newValue)
 setter method for MinResizeHeight

virtual bool getMaximized ()
 getter method for Maximized

virtual void setMaximized (bool newValue)
 setter method for Maximized

virtual bool getResizable ()
 getter method for Resizable

virtual void setResizable (bool newValue)
 setter method for Resizable

virtual QButtongetCloseButton ()
 getter method for CloseButton

virtual QButtongetMaximizeButton ()
 getter method for MaximizeButton

QFontgetFont ()
 getter method for Font

QColorgetTitleBarColor ()
 getter method for TitleBarColor

QColorgetTitleBarColorInactive ()
 getter method for TitleBarColorInactive

void print ()
 prints itself to the cout

 QWindow (QWidget *aOwner)
 Constructor.

virtual ~QWindow ()
 Destructor.

virtual void drawFrame ()
 draws frame

void drawCoordInfos (int x, int y, const char *Text)
 draws frame

void drawCloseButton ()
 draws close button

void drawMaximizeButton ()
 draws maximize button

void maximize ()
 maximize window

virtual void draw (QEvent *e)
 draws itself with OpenGL. Here is the OpenGL drawing code

virtual void layout ()
 layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes

virtual bool canDrag (QEvent *e)
 have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged

virtual bool processEvent (QEvent *e)
 processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner

virtual bool processMouseOwner (QEvent *e)
 processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner

virtual void childrenChanged ()
 called if a child is added/removed

virtual bool canFocus (QEvent *e)
 defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus

virtual void Init ()
 initialization code

virtual void CleanUp ()
 clean up code

virtual int getTitleBarHeight ()
 getter method for TitleBarHeight

virtual void setTitleBarHeight (int newValue)
 setter method for TitleBarHeight

virtual int getTitleBarBorder ()
 getter method for TitleBarBorder

virtual void setTitleBarBorder (int newValue)
 setter method for TitleBarBorder

virtual string getCaption ()
 getter method for Caption

virtual void setCaption (string newValue)
 setter method for Caption

virtual int getMinResizeWidth ()
 getter method for MinResizeWidth

virtual void setMinResizeWidth (int newValue)
 setter method for MinResizeWidth

virtual int getMinResizeHeight ()
 getter method for MinResizeHeight

virtual void setMinResizeHeight (int newValue)
 setter method for MinResizeHeight

virtual bool getMaximized ()
 getter method for Maximized

virtual void setMaximized (bool newValue)
 setter method for Maximized

virtual bool getResizable ()
 getter method for Resizable

virtual void setResizable (bool newValue)
 setter method for Resizable

virtual QButtongetCloseButton ()
 getter method for CloseButton

virtual QButtongetMaximizeButton ()
 getter method for MaximizeButton

QFontgetFont ()
 getter method for Font

QColorgetTitleBarColor ()
 getter method for TitleBarColor

QColorgetTitleBarColorInactive ()
 getter method for TitleBarColorInactive

void print ()
 prints itself to the cout

 QWindow (QWidget *aOwner)
 Constructor.

virtual ~QWindow ()
 Destructor.


Protected Attributes

int TitleBarHeight
 titlebar height

int TitleBarBorder
 titlebar border

string Caption
 caption of the window

int MinResizeWidth
 minimum allowed width if resizing with mouse

int MinResizeHeight
 minimum allowed height if resizing with mouse

bool Maximized
 indicates whether the window is currently maximized

bool Resizable
 defines whether the window can be resized by mouse

QButtonCloseButton
 Button for close.

QButtonMaximizeButton
 Button for maximize.

QFontFont
 widget for caption text

QColorTitleBarColor
 color of Title bar

QColorTitleBarColorInactive
 color of title bar if window is not active

QButtonCloseButton
 Button for close.

QButtonMaximizeButton
 Button for maximize.

QFontFont
 widget for caption text

QColorTitleBarColor
 color of Title bar

QColorTitleBarColorInactive
 color of title bar if window is not active


Private Attributes

bool Resizing
 indicates whether the window is currently resizing

int OldLeft
 old position for restore from maximize

int OldTop
 old position for restore from maximize

int OldWidth
 old position for restore from maximize

int OldHeight
 old position for restore from maximize

int ResizeStartX
 position x at the beginning of the resizing

int ResizeStartY
 position y at the beginning of the resizing


Detailed Description

Widget which is a GUI-Window.

Definition at line 19 of file QWindow.h.


Constructor & Destructor Documentation

QWindow::QWindow QWidget   aOwner
 

Constructor.

Definition at line 423 of file QWindow.cpp.

QWindow::~QWindow   [virtual]
 

Destructor.

Definition at line 450 of file QWindow.cpp.

QWindow::QWindow QWidget   aOwner
 

Constructor.

virtual QWindow::~QWindow   [virtual]
 

Destructor.


Member Function Documentation

virtual bool QWindow::canDrag QEvent   e [virtual]
 

have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged

Reimplemented from QWidget.

bool QWindow::canDrag QEvent   e [virtual]
 

have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged

Reimplemented from QWidget.

Definition at line 169 of file QWindow.cpp.

References QEvent::getY(), TitleBarHeight, and QWidget::Top.

virtual bool QWindow::canFocus QEvent   e [virtual]
 

defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus

Reimplemented from QWidget.

bool QWindow::canFocus QEvent   e [virtual]
 

defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus

Reimplemented from QWidget.

Definition at line 244 of file QWindow.cpp.

virtual void QWindow::childrenChanged   [virtual]
 

called if a child is added/removed

Reimplemented from QWidget.

void QWindow::childrenChanged   [virtual]
 

called if a child is added/removed

Reimplemented from QWidget.

Definition at line 239 of file QWindow.cpp.

virtual void QWindow::CleanUp   [virtual]
 

clean up code

Reimplemented from QWidget.

void QWindow::CleanUp   [virtual]
 

clean up code

Reimplemented from QWidget.

Definition at line 284 of file QWindow.cpp.

virtual void QWindow::draw QEvent   e [virtual]
 

draws itself with OpenGL. Here is the OpenGL drawing code

Reimplemented from QWidget.

void QWindow::draw QEvent   e [virtual]
 

draws itself with OpenGL. Here is the OpenGL drawing code

Reimplemented from QWidget.

Definition at line 155 of file QWindow.cpp.

References drawFrame().

void QWindow::drawCloseButton  
 

draws close button

void QWindow::drawCloseButton  
 

draws close button

Definition at line 108 of file QWindow.cpp.

References CloseButton, QLookAndFeel::drawCloseButton(), QWidget::getHeight(), QButton::getState(), QWidget::getWidth(), and QWidget::LookAndFeel.

Referenced by drawCloseButtonHandler().

void QWindow::drawCoordInfos int    x,
int    y,
const char *    Text
 

draws frame

void QWindow::drawCoordInfos int    x,
int    y,
const char *    Text
 

draws info about size/position. Semi transparent rectangle with window font

Definition at line 94 of file QWindow.cpp.

References QFont::drawAtPos(), QLookAndFeel::drawRect(), Font, QFont::getSize(), QFont::getTextWidth(), and QWidget::LookAndFeel.

Referenced by drawFrame().

virtual void QWindow::drawFrame   [virtual]
 

draws frame

void QWindow::drawFrame   [virtual]
 

draws frame

Definition at line 15 of file QWindow.cpp.

References Caption, QFont::drawAtPos(), QLookAndFeel::drawBevel(), drawCoordInfos(), QLookAndFeel::drawRect(), Font, QLookAndFeel::getBackGroundColor(), QWidget::getFocusPath(), QWidget::getLeft(), QFont::getLengthForWidth(), QWidget::Height, QWidget::Left, QWidget::LookAndFeel, MaximizeButton, QWidget::Owner, QColor::setAsCurrent(), QFont::setBold(), TitleBarBorder, TitleBarColor, TitleBarColorInactive, TitleBarHeight, QWidget::Top, and QWidget::Width.

Referenced by draw().

void QWindow::drawMaximizeButton  
 

draws maximize button

void QWindow::drawMaximizeButton  
 

draws maximize button

Definition at line 119 of file QWindow.cpp.

References QLookAndFeel::drawMaximizeButton(), QWidget::getHeight(), QButton::getState(), QWidget::getWidth(), QWidget::LookAndFeel, and MaximizeButton.

Referenced by drawMaximizeButtonHandler().

virtual string QWindow::getCaption   [virtual]
 

getter method for Caption

string QWindow::getCaption   [virtual]
 

getter method for Caption

Definition at line 314 of file QWindow.cpp.

References Caption.

virtual QButton* QWindow::getCloseButton   [virtual]
 

getter method for CloseButton

QButton * QWindow::getCloseButton   [virtual]
 

getter method for CloseButton

Definition at line 374 of file QWindow.cpp.

References CloseButton.

QFont* QWindow::getFont  
 

getter method for Font

QFont * QWindow::getFont  
 

getter method for Font

Definition at line 386 of file QWindow.cpp.

References Font.

virtual QButton* QWindow::getMaximizeButton   [virtual]
 

getter method for MaximizeButton

QButton * QWindow::getMaximizeButton   [virtual]
 

getter method for MaximizeButton

Definition at line 380 of file QWindow.cpp.

References MaximizeButton.

virtual bool QWindow::getMaximized   [virtual]
 

getter method for Maximized

bool QWindow::getMaximized   [virtual]
 

getter method for Maximized

Definition at line 350 of file QWindow.cpp.

References Maximized.

virtual int QWindow::getMinResizeHeight   [virtual]
 

getter method for MinResizeHeight

int QWindow::getMinResizeHeight   [virtual]
 

getter method for MinResizeHeight

Definition at line 338 of file QWindow.cpp.

References MinResizeHeight.

virtual int QWindow::getMinResizeWidth   [virtual]
 

getter method for MinResizeWidth

int QWindow::getMinResizeWidth   [virtual]
 

getter method for MinResizeWidth

Definition at line 326 of file QWindow.cpp.

References MinResizeWidth.

virtual bool QWindow::getResizable   [virtual]
 

getter method for Resizable

bool QWindow::getResizable   [virtual]
 

getter method for Resizable

Definition at line 362 of file QWindow.cpp.

References Resizable.

virtual int QWindow::getTitleBarBorder   [virtual]
 

getter method for TitleBarBorder

int QWindow::getTitleBarBorder   [virtual]
 

getter method for TitleBarBorder

Definition at line 302 of file QWindow.cpp.

References TitleBarBorder.

QColor* QWindow::getTitleBarColor  
 

getter method for TitleBarColor

QColor * QWindow::getTitleBarColor  
 

getter method for TitleBarColor

Definition at line 392 of file QWindow.cpp.

References TitleBarColor.

QColor* QWindow::getTitleBarColorInactive  
 

getter method for TitleBarColorInactive

QColor * QWindow::getTitleBarColorInactive  
 

getter method for TitleBarColorInactive

Definition at line 398 of file QWindow.cpp.

References TitleBarColorInactive.

virtual int QWindow::getTitleBarHeight   [virtual]
 

getter method for TitleBarHeight

int QWindow::getTitleBarHeight   [virtual]
 

getter method for TitleBarHeight

Definition at line 290 of file QWindow.cpp.

References TitleBarHeight.

virtual void QWindow::Init   [virtual]
 

initialization code

Reimplemented from QWidget.

void QWindow::Init   [virtual]
 

initialization code

Reimplemented from QWidget.

Definition at line 250 of file QWindow.cpp.

References Caption, QWidget::ClientBorderBottom, QWidget::ClientBorderLeft, QWidget::ClientBorderRight, QWidget::ClientBorderTop, CloseButton, Font, QFont::getColor(), QWidget::getHeight(), QWidget::getTop(), QWidget::getWidth(), MaximizeButton, QWidget::MinHeight, MinResizeHeight, MinResizeWidth, QWidget::MinWidth, QWidget::onClick, QWidget::onCustomDraw, QColor::set(), QWidget::setHeight(), QFont::setSize(), QWidget::setTop(), QWidget::setWidth(), TitleBarBorder, TitleBarColor, TitleBarColorInactive, and TitleBarHeight.

virtual void QWindow::layout   [virtual]
 

layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes

Reimplemented from QWidget.

Reimplemented in MyWindow, and MyWindow.

void QWindow::layout   [virtual]
 

layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes

Reimplemented from QWidget.

Reimplemented in MyWindow, and MyWindow.

Definition at line 162 of file QWindow.cpp.

References CloseButton, QWidget::getLeft(), QWidget::getWidth(), MaximizeButton, QWidget::setLeft(), TitleBarBorder, and QWidget::Width.

Referenced by MyWindow::layout().

void QWindow::maximize  
 

maximize window

void QWindow::maximize  
 

maximize / restore window. If window is maximized, restore its size/position, else maximize its size

Definition at line 130 of file QWindow.cpp.

References QWidget::getClientBorderBottom(), QWidget::getClientBorderLeft(), QWidget::getClientBorderRight(), QWidget::getClientBorderTop(), QWidget::getHeight(), QWidget::getWidth(), QWidget::Height, QWidget::Left, Maximized, OldHeight, OldLeft, OldTop, OldWidth, QWidget::Owner, QWidget::setHeight(), QWidget::setLeft(), QWidget::setTop(), QWidget::setWidth(), QWidget::Top, and QWidget::Width.

Referenced by MaximizeButtonHandler().

void QWindow::print  
 

prints itself to the cout

Reimplemented from QWidget.

void QWindow::print  
 

prints itself to the cout

Reimplemented from QWidget.

Definition at line 406 of file QWindow.cpp.

virtual bool QWindow::processEvent QEvent   e [virtual]
 

processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner

Reimplemented from QWidget.

bool QWindow::processEvent QEvent   e [virtual]
 

processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner

Reimplemented from QWidget.

Definition at line 176 of file QWindow.cpp.

References QEvent::getButton(), QEvent::getType(), QEvent::getX(), QEvent::getY(), QWidget::Height, QWidget::Left, Resizable, ResizeStartX, ResizeStartY, Resizing, QWidget::Top, and QWidget::Width.

virtual bool QWindow::processMouseOwner QEvent   e [virtual]
 

processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner

Reimplemented from QWidget.

bool QWindow::processMouseOwner QEvent   e [virtual]
 

processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner

Reimplemented from QWidget.

Definition at line 195 of file QWindow.cpp.

References QEvent::getButton(), QWidget::getHeight(), QEvent::getType(), QWidget::getWidth(), QEvent::getX(), QEvent::getY(), QWidget::Left, MinResizeHeight, MinResizeWidth, QWidget::Owner, ResizeStartX, ResizeStartY, Resizing, QWidget::setHeight(), QWidget::setWidth(), and QWidget::Top.

virtual void QWindow::setCaption string    newValue [virtual]
 

setter method for Caption

void QWindow::setCaption string    newValue [virtual]
 

setter method for Caption

Definition at line 320 of file QWindow.cpp.

References Caption.

Referenced by myMethod1().

virtual void QWindow::setMaximized bool    newValue [virtual]
 

setter method for Maximized

void QWindow::setMaximized bool    newValue [virtual]
 

setter method for Maximized

Definition at line 356 of file QWindow.cpp.

References Maximized.

virtual void QWindow::setMinResizeHeight int    newValue [virtual]
 

setter method for MinResizeHeight

void QWindow::setMinResizeHeight int    newValue [virtual]
 

setter method for MinResizeHeight

Definition at line 344 of file QWindow.cpp.

References MinResizeHeight.

virtual void QWindow::setMinResizeWidth int    newValue [virtual]
 

setter method for MinResizeWidth

void QWindow::setMinResizeWidth int    newValue [virtual]
 

setter method for MinResizeWidth

Definition at line 332 of file QWindow.cpp.

References MinResizeWidth.

virtual void QWindow::setResizable bool    newValue [virtual]
 

setter method for Resizable

void QWindow::setResizable bool    newValue [virtual]
 

setter method for Resizable

Definition at line 368 of file QWindow.cpp.

References Resizable.

virtual void QWindow::setTitleBarBorder int    newValue [virtual]
 

setter method for TitleBarBorder

void QWindow::setTitleBarBorder int    newValue [virtual]
 

setter method for TitleBarBorder

Definition at line 308 of file QWindow.cpp.

References TitleBarBorder.

virtual void QWindow::setTitleBarHeight int    newValue [virtual]
 

setter method for TitleBarHeight

void QWindow::setTitleBarHeight int    newValue [virtual]
 

setter method for TitleBarHeight

Definition at line 296 of file QWindow.cpp.

References TitleBarHeight.


Field Documentation

string QWindow::Caption [protected]
 

caption of the window

Definition at line 52 of file QWindow.h.

Referenced by drawFrame(), getCaption(), Init(), and setCaption().

QButton* QWindow::CloseButton [protected]
 

Button for close.

Definition at line 67 of file QWindow.h.

QButton* QWindow::CloseButton [protected]
 

Button for close.

Definition at line 66 of file QWindow.h.

Referenced by drawCloseButton(), getCloseButton(), Init(), and layout().

QFont* QWindow::Font [protected]
 

widget for caption text

Definition at line 73 of file QWindow.h.

QFont* QWindow::Font [protected]
 

widget for caption text

Definition at line 72 of file QWindow.h.

Referenced by drawCoordInfos(), drawFrame(), getFont(), and Init().

QButton* QWindow::MaximizeButton [protected]
 

Button for maximize.

Definition at line 70 of file QWindow.h.

QButton* QWindow::MaximizeButton [protected]
 

Button for maximize.

Definition at line 69 of file QWindow.h.

Referenced by drawFrame(), drawMaximizeButton(), getMaximizeButton(), Init(), and layout().

bool QWindow::Maximized [protected]
 

indicates whether the window is currently maximized

Definition at line 61 of file QWindow.h.

Referenced by getMaximized(), maximize(), and setMaximized().

int QWindow::MinResizeHeight [protected]
 

minimum allowed height if resizing with mouse

Definition at line 58 of file QWindow.h.

Referenced by getMinResizeHeight(), Init(), processMouseOwner(), and setMinResizeHeight().

int QWindow::MinResizeWidth [protected]
 

minimum allowed width if resizing with mouse

Definition at line 55 of file QWindow.h.

Referenced by getMinResizeWidth(), Init(), processMouseOwner(), and setMinResizeWidth().

int QWindow::OldHeight [private]
 

old position for restore from maximize

Definition at line 36 of file QWindow.h.

Referenced by maximize().

int QWindow::OldLeft [private]
 

old position for restore from maximize

Definition at line 27 of file QWindow.h.

Referenced by maximize().

int QWindow::OldTop [private]
 

old position for restore from maximize

Definition at line 30 of file QWindow.h.

Referenced by maximize().

int QWindow::OldWidth [private]
 

old position for restore from maximize

Definition at line 33 of file QWindow.h.

Referenced by maximize().

bool QWindow::Resizable [protected]
 

defines whether the window can be resized by mouse

Definition at line 64 of file QWindow.h.

Referenced by getResizable(), processEvent(), and setResizable().

int QWindow::ResizeStartX [private]
 

position x at the beginning of the resizing

Definition at line 39 of file QWindow.h.

Referenced by processEvent(), and processMouseOwner().

int QWindow::ResizeStartY [private]
 

position y at the beginning of the resizing

Definition at line 42 of file QWindow.h.

Referenced by processEvent(), and processMouseOwner().

bool QWindow::Resizing [private]
 

indicates whether the window is currently resizing

Definition at line 24 of file QWindow.h.

Referenced by processEvent(), and processMouseOwner().

int QWindow::TitleBarBorder [protected]
 

titlebar border

Definition at line 49 of file QWindow.h.

Referenced by drawFrame(), getTitleBarBorder(), Init(), layout(), and setTitleBarBorder().

QColor* QWindow::TitleBarColor [protected]
 

color of Title bar

Definition at line 76 of file QWindow.h.

QColor* QWindow::TitleBarColor [protected]
 

color of Title bar

Definition at line 75 of file QWindow.h.

Referenced by drawFrame(), getTitleBarColor(), and Init().

QColor* QWindow::TitleBarColorInactive [protected]
 

color of title bar if window is not active

Definition at line 79 of file QWindow.h.

QColor* QWindow::TitleBarColorInactive [protected]
 

color of title bar if window is not active

Definition at line 78 of file QWindow.h.

Referenced by drawFrame(), getTitleBarColorInactive(), and Init().

int QWindow::TitleBarHeight [protected]
 

titlebar height

Definition at line 46 of file QWindow.h.

Referenced by canDrag(), drawFrame(), getTitleBarHeight(), Init(), and setTitleBarHeight().


The documentation for this class was generated from the following files:
Generated on Thu Mar 18 18:34:35 2004 for miniQT by doxygen1.2.18