kmdi Library: KMdiChildFrmCaption Class Reference (kmdi Library)

| # kmdi Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KMdiChildFrmCaption Class Reference

Internal class. More...

`#include <kmdichildfrmcaption.h>`

Inheritance diagram for KMdiChildFrmCaption:

[legend]
Collaboration diagram for KMdiChildFrmCaption:

[legend]
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
KMdiChildFrm * | m_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 68 of file kmdichildfrmcaption.cpp. References m_bActive, m_bChildInDrag, m_pParent, m_szCaption, QWidget::setBackgroundMode(), and QWidget::setFocusPolicy().

KMdiChildFrmCaption::~KMdiChildFrmCaption | ( |  | ) |

| Destructor. Definition at line 81 of file kmdichildfrmcaption.cpp.

## Member Function Documentation

void KMdiChildFrmCaption::setActive | ( | bool | bActive | ) |

| Repaint the caption bar in active background colors. Definition at line 171 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(), and KMdiChildFrm::raiseAndActivate().

void KMdiChildFrmCaption::setCaption | ( | const QString & | text | ) |

| Repaint with a new caption bar title. Reimplemented from QWidget. Definition at line 190 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 198 of file kmdichildfrmcaption.cpp. References KMdiChildArea::m_captionFontLineSpacing, KMdiChildFrm::m_pManager, and m_pParent. Referenced by KMdiChildFrm::doResize(), 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 310 of file kmdichildfrmcaption.cpp. References 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 227 of file kmdichildfrmcaption.cpp. References abbreviateText(), QPainter::drawText(), QPainter::fillRect(), 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 86 of file kmdichildfrmcaption.cpp. References KMdiChildFrm::m_bDragging, m_offset, m_pParent, QWidget::mapToGlobal(), QWidget::mapToParent(), QPopupMenu::popup(), 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 303 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 106 of file kmdichildfrmcaption.cpp. References 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 131 of file kmdichildfrmcaption.cpp. References 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 Replace with a call to a KStringHandler function instead of rolling our own. Definition at line 261 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 116 of file kmdichildfrmcaption.h. Referenced by KMdiChildFrmCaption(), paintEvent(), and setCaption().

KMdiChildFrm* KMdiChildFrmCaption::m_pParent`[protected]`

| parent widget Definition at line 122 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 127 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 132 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 137 of file kmdichildfrmcaption.h. Referenced by KMdiChildFrmCaption(), mouseMoveEvent(), and mouseReleaseEvent().

The documentation for this class was generated from the following files:

- kmdichildfrmcaption.h
- kmdichildfrmcaption.cpp

This file is part of the documentation for kmdi Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:32:09 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003