kmdi Library API Documentation

KMdiChildFrmCaption Class Reference

Internal class. More...

#include <kmdichildfrmcaption.h>

Inheritance diagram for KMdiChildFrmCaption:

QWidget List of all members.

Public Slots

void slot_moveViaSystemMenu ()

Public Member Functions

 KMdiChildFrmCaption (KMdiChildFrm *parent)
 ~KMdiChildFrmCaption ()
void setActive (bool bActive)
void setCaption (const QString &text)
int heightHint ()

Public Attributes

QString m_szCaption

Protected Member Functions

virtual void paintEvent (QPaintEvent *e)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseDoubleClickEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *e)
QString abbreviateText (QString origStr, int maxWidth)

Protected Attributes

KMdiChildFrmm_pParent
bool m_bActive
QPoint m_offset
bool m_bChildInDrag

Detailed Description

Internal class.

It's the caption bar of a child frame widget.

Definition at line 44 of file kmdichildfrmcaption.h.


Constructor & Destructor Documentation

KMdiChildFrmCaption::KMdiChildFrmCaption KMdiChildFrm parent  ) 
 

Constructor.

Definition at line 52 of file kmdichildfrmcaption.cpp.

References m_bActive, m_bChildInDrag, m_pParent, m_szCaption, QWidget::setBackgroundMode(), and QWidget::setFocusPolicy().

KMdiChildFrmCaption::~KMdiChildFrmCaption  ) 
 

Destructor.

Definition at line 65 of file kmdichildfrmcaption.cpp.


Member Function Documentation

void KMdiChildFrmCaption::setActive bool  bActive  ) 
 

Repaint the caption bar in active background colors.

Definition at line 145 of file kmdichildfrmcaption.cpp.

References m_bActive, KMdiChildArea::m_captionActiveBackColor, KMdiChildArea::m_captionInactiveBackColor, KMdiChildFrm::m_pManager, m_pParent, KMdiChildFrm::m_pUnixIcon, KMdiChildFrm::m_pWinIcon, and QWidget::repaint().

Referenced by KMdiChildArea::focusTopChild(), KMdiChildFrm::mousePressEvent(), KMdiChildFrm::raiseAndActivate(), and KMdiChildArea::setTopChild().

void KMdiChildFrmCaption::setCaption const QString text  ) 
 

Repaint with a new caption bar title.

Reimplemented from QWidget.

Definition at line 164 of file kmdichildfrmcaption.cpp.

References m_szCaption, and QWidget::repaint().

Referenced by KMdiChildFrm::setCaption().

int KMdiChildFrmCaption::heightHint  ) 
 

Returns the caption bar height depending on the used font.

Definition at line 172 of file kmdichildfrmcaption.cpp.

References KMdiMainFrm::frameDecorOfAttachedViews(), KMdiChildArea::m_captionFontLineSpacing, KMdiChildFrm::m_pManager, and m_pParent.

Referenced by KMdiChildFrm::doResize(), KMdiChildFrm::eventFilter(), KMdiChildArea::getCascadePoint(), KMdiChildFrm::KMdiChildFrm(), KMdiChildArea::resizeEvent(), KMdiChildFrm::resizeWindow(), KMdiChildFrm::setClient(), and KMdiChildFrm::setState().

void KMdiChildFrmCaption::slot_moveViaSystemMenu  )  [slot]
 

Grabs the mouse, a move cursor, sets a move indicator variable to true and keeps the global mouse position in mind.

Definition at line 268 of file kmdichildfrmcaption.cpp.

References KMdiMainFrm::frameDecorOfAttachedViews(), QWidget::grabMouse(), KMdiChildFrm::m_bDragging, m_offset, m_pParent, QWidget::mapFromGlobal(), QWidget::setMouseTracking(), and QApplication::setOverrideCursor().

void KMdiChildFrmCaption::paintEvent QPaintEvent e  )  [protected, virtual]
 

Draws the caption bar and its title using the settings.

Reimplemented from QWidget.

Definition at line 193 of file kmdichildfrmcaption.cpp.

References abbreviateText(), QPainter::drawText(), QPainter::fillRect(), KMdiMainFrm::frameDecorOfAttachedViews(), KMdiChildFrm::icon(), QRect::left(), m_bActive, KMdiChildArea::m_captionActiveBackColor, KMdiChildArea::m_captionActiveForeColor, KMdiChildArea::m_captionFont, KMdiChildArea::m_captionInactiveBackColor, KMdiChildArea::m_captionInactiveForeColor, KMdiChildFrm::m_pClose, KMdiChildFrm::m_pManager, m_pParent, m_szCaption, QWidget::rect(), QPainter::setFont(), QRect::setLeft(), QPainter::setPen(), QWidget::width(), and QPixmap::width().

void KMdiChildFrmCaption::mousePressEvent QMouseEvent  )  [protected, virtual]
 

The same as KMdiChildFrmCaption::slot_moveViaSystemMenu.

Reimplemented from QWidget.

Definition at line 71 of file kmdichildfrmcaption.cpp.

References QMouseEvent::button(), KMdiMainFrm::frameDecorOfAttachedViews(), KMdiChildFrm::m_bDragging, m_offset, m_pParent, QWidget::mapToGlobal(), QWidget::mapToParent(), QPopupMenu::popup(), QMouseEvent::pos(), QWidget::setMouseTracking(), QApplication::setOverrideCursor(), and KMdiChildFrm::systemMenu().

void KMdiChildFrmCaption::mouseDoubleClickEvent QMouseEvent  )  [protected, virtual]
 

Calls maximizePressed of the parent widget ( KMdiChildFrm ).

Reimplemented from QWidget.

Definition at line 261 of file kmdichildfrmcaption.cpp.

References m_pParent, and KMdiChildFrm::maximizePressed().

void KMdiChildFrmCaption::mouseReleaseEvent QMouseEvent  )  [protected, virtual]
 

Restore the normal mouse cursor, set the state variable back to 'not moving'.

Reimplemented from QWidget.

Definition at line 88 of file kmdichildfrmcaption.cpp.

References QMouseEvent::button(), KMdiMainFrm::frameDecorOfAttachedViews(), m_bChildInDrag, KMdiChildFrm::m_bDragging, KMdiChildFrm::m_pClient, m_pParent, QWidget::releaseMouse(), QApplication::restoreOverrideCursor(), and QApplication::sendEvent().

void KMdiChildFrmCaption::mouseMoveEvent QMouseEvent e  )  [protected, virtual]
 

Checks if out of move range of the KMdiChildArea and calls KMdiChildFrm::move.

Reimplemented from QWidget.

Definition at line 109 of file kmdichildfrmcaption.cpp.

References QMouseEvent::globalPos(), m_bChildInDrag, KMdiChildFrm::m_bDragging, m_offset, KMdiChildFrm::m_pClient, KMdiChildFrm::m_pManager, m_pParent, QWidget::parentWidget(), QPoint::rx(), QPoint::ry(), QApplication::sendEvent(), QPoint::x(), and QPoint::y().

QString KMdiChildFrmCaption::abbreviateText QString  origStr,
int  maxWidth
[protected]
 

Computes a new abbreviated string from a given string depending on a given maximum width.

Definition at line 223 of file kmdichildfrmcaption.cpp.

References QWidget::fontMetrics(), QString::left(), QString::length(), QString::right(), and QFontMetrics::width().

Referenced by paintEvent().


Member Data Documentation

QString KMdiChildFrmCaption::m_szCaption
 

the title string shown in the caption bar

Definition at line 106 of file kmdichildfrmcaption.h.

Referenced by KMdiChildFrm::caption(), KMdiChildFrmCaption(), paintEvent(), and setCaption().

KMdiChildFrm* KMdiChildFrmCaption::m_pParent [protected]
 

parent widget

Definition at line 112 of file kmdichildfrmcaption.h.

Referenced by heightHint(), KMdiChildFrmCaption(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), setActive(), and slot_moveViaSystemMenu().

bool KMdiChildFrmCaption::m_bActive [protected]
 

state variable indicating whether activated or not activated

Definition at line 116 of file kmdichildfrmcaption.h.

Referenced by KMdiChildFrmCaption(), paintEvent(), and setActive().

QPoint KMdiChildFrmCaption::m_offset [protected]
 

the position offset related to its parent widget (internally used for translating mouse move positions

Definition at line 120 of file kmdichildfrmcaption.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and slot_moveViaSystemMenu().

bool KMdiChildFrmCaption::m_bChildInDrag [protected]
 

True if the child knows that it is currently being dragged.

Definition at line 124 of file kmdichildfrmcaption.h.

Referenced by KMdiChildFrmCaption(), mouseMoveEvent(), and mouseReleaseEvent().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmdi Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:21:58 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003