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

QCaptionButton Class Reference

Button with Caption. More...

#include <QCaptionButton.h>

Inheritance diagram for QCaptionButton:

Inheritance graph
[legend]
Collaboration diagram for QCaptionButton:

Collaboration graph
[legend]

Public Methods

virtual void updateCaptionPosition ()
 overwrite this to recalculate caption position

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 string getCaption ()
 getter method for Caption

virtual void setCaption (string newValue)
 setter method for Caption

QFontgetFont ()
 getter method for Font

void print ()
 prints itself to the cout

 QCaptionButton (QWidget *aOwner)
 Constructor.

virtual ~QCaptionButton ()
 Destructor.

virtual void updateCaptionPosition ()
 overwrite this to recalculate caption position

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 string getCaption ()
 getter method for Caption

virtual void setCaption (string newValue)
 setter method for Caption

QFontgetFont ()
 getter method for Font

void print ()
 prints itself to the cout

 QCaptionButton (QWidget *aOwner)
 Constructor.

virtual ~QCaptionButton ()
 Destructor.


Protected Attributes

string Caption
 caption of the button

QFontFont
 used to draw caption

QFontFont
 used to draw caption


Private Attributes

int CaptionPositionX
 x position of the caption (centered)


Detailed Description

Button with Caption.

Definition at line 17 of file QCaptionButton.h.


Constructor & Destructor Documentation

QCaptionButton::QCaptionButton QWidget   aOwner
 

Constructor.

Definition at line 131 of file QCaptionButton.cpp.

QCaptionButton::~QCaptionButton   [virtual]
 

Destructor.

Definition at line 141 of file QCaptionButton.cpp.

QCaptionButton::QCaptionButton QWidget   aOwner
 

Constructor.

virtual QCaptionButton::~QCaptionButton   [virtual]
 

Destructor.


Member Function Documentation

virtual bool QCaptionButton::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 QButton.

bool QCaptionButton::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 QButton.

Definition at line 57 of file QCaptionButton.cpp.

virtual bool QCaptionButton::canFocus QEvent   e [virtual]
 

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

Reimplemented from QButton.

bool QCaptionButton::canFocus QEvent   e [virtual]
 

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

Reimplemented from QButton.

Definition at line 80 of file QCaptionButton.cpp.

virtual void QCaptionButton::childrenChanged   [virtual]
 

called if a child is added/removed

Reimplemented from QButton.

void QCaptionButton::childrenChanged   [virtual]
 

called if a child is added/removed

Reimplemented from QButton.

Definition at line 75 of file QCaptionButton.cpp.

virtual void QCaptionButton::CleanUp   [virtual]
 

clean up code

Reimplemented from QButton.

void QCaptionButton::CleanUp   [virtual]
 

clean up code

Reimplemented from QButton.

Definition at line 95 of file QCaptionButton.cpp.

References QButton::CleanUp().

virtual void QCaptionButton::draw QEvent   e [virtual]
 

draws itself with OpenGL. Here is the OpenGL drawing code

Reimplemented from QButton.

void QCaptionButton::draw QEvent   e [virtual]
 

draws itself with OpenGL. Here is the OpenGL drawing code

Reimplemented from QButton.

Definition at line 23 of file QCaptionButton.cpp.

References Caption, CaptionPositionX, QFont::drawAtPos(), QLookAndFeel::drawBevel(), QLookAndFeel::drawRect(), Font, QLookAndFeel::getBackGroundColor(), QWidget::getFocused(), QLookAndFeel::getHighlightColor(), QFont::getLengthForWidth(), QWidget::Height, QWidget::LookAndFeel, QColor::setAsCurrent(), QButton::State, and QWidget::Width.

virtual string QCaptionButton::getCaption   [virtual]
 

getter method for Caption

string QCaptionButton::getCaption   [virtual]
 

getter method for Caption

Definition at line 101 of file QCaptionButton.cpp.

References Caption.

Referenced by myMethod2().

QFont* QCaptionButton::getFont  
 

getter method for Font

QFont * QCaptionButton::getFont  
 

getter method for Font

Definition at line 114 of file QCaptionButton.cpp.

References Font.

virtual void QCaptionButton::Init   [virtual]
 

initialization code

Reimplemented from QButton.

void QCaptionButton::Init   [virtual]
 

initialization code

Reimplemented from QButton.

Definition at line 86 of file QCaptionButton.cpp.

References QFont::copyFrom(), Font, QLookAndFeel::getFont(), QWidget::Height, QButton::Init(), QWidget::LookAndFeel, and setCaption().

virtual void QCaptionButton::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 QButton.

void QCaptionButton::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 QButton.

Definition at line 50 of file QCaptionButton.cpp.

References QButton::layout(), and updateCaptionPosition().

void QCaptionButton::print  
 

prints itself to the cout

Reimplemented from QButton.

void QCaptionButton::print  
 

prints itself to the cout

Reimplemented from QButton.

Definition at line 122 of file QCaptionButton.cpp.

virtual bool QCaptionButton::processEvent QEvent   e [virtual]
 

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

Reimplemented from QButton.

bool QCaptionButton::processEvent QEvent   e [virtual]
 

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

Reimplemented from QButton.

Definition at line 63 of file QCaptionButton.cpp.

References QButton::processEvent().

virtual bool QCaptionButton::processMouseOwner QEvent   e [virtual]
 

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

Reimplemented from QButton.

bool QCaptionButton::processMouseOwner QEvent   e [virtual]
 

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

Reimplemented from QButton.

Definition at line 69 of file QCaptionButton.cpp.

References QButton::processMouseOwner().

virtual void QCaptionButton::setCaption string    newValue [virtual]
 

setter method for Caption

void QCaptionButton::setCaption string    newValue [virtual]
 

setter method for Caption

Definition at line 107 of file QCaptionButton.cpp.

References Caption, and updateCaptionPosition().

Referenced by Init(), main(), and MyWindow::MyWindow().

virtual void QCaptionButton::updateCaptionPosition   [virtual]
 

overwrite this to recalculate caption position

void QCaptionButton::updateCaptionPosition   [virtual]
 

overwrite this to recalculate caption position

Definition at line 14 of file QCaptionButton.cpp.

References Caption, CaptionPositionX, Font, QFont::getTextWidth(), and QWidget::Width.

Referenced by layout(), and setCaption().


Field Documentation

string QCaptionButton::Caption [protected]
 

caption of the button

Definition at line 26 of file QCaptionButton.h.

Referenced by draw(), getCaption(), setCaption(), and updateCaptionPosition().

int QCaptionButton::CaptionPositionX [private]
 

x position of the caption (centered)

Definition at line 22 of file QCaptionButton.h.

Referenced by draw(), and updateCaptionPosition().

QFont* QCaptionButton::Font [protected]
 

used to draw caption

Definition at line 29 of file QCaptionButton.h.

QFont* QCaptionButton::Font [protected]
 

used to draw caption

Definition at line 28 of file QCaptionButton.h.

Referenced by draw(), getFont(), Init(), and updateCaptionPosition().


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