kmdi Library API Documentation

KMdiChildArea Class Reference

Internal class. More...

#include <kmdichildarea.h>

Inheritance diagram for KMdiChildArea:

QFrame List of all members.

Public Slots

void cascadeWindows ()
void cascadeMaximized ()
void expandVertical ()
void expandHorizontal ()
void focusTopChild ()
void tilePragma ()
void tileAnodine ()
void tileVertically ()
void layoutMinimizedChildren ()

Signals

void noMaximizedChildFrmLeft (KMdiChildFrm *)
void nowMaximized (bool)
void sysButtonConnectionsMustChange (KMdiChildFrm *, KMdiChildFrm *)
void popupWindowMenu (QPoint)
void lastChildFrmClosed ()

Public Member Functions

 KMdiChildArea (QWidget *parent)
 ~KMdiChildArea ()
void manageChild (KMdiChildFrm *lpC, bool bShow=true, bool bCascade=true)
void destroyChild (KMdiChildFrm *lpC, bool bFocusTopChild=true)
void destroyChildButNotItsView (KMdiChildFrm *lpC, bool bFocusTopChild=true)
void setTopChild (KMdiChildFrm *lpC, bool bSetFocus=false)
KMdiChildFrmtopChild () const
int getVisibleChildCount () const
QPoint getCascadePoint (int indexOfWindow=-1)
void setMdiCaptionFont (const QFont &fnt)
void setMdiCaptionActiveForeColor (const QColor &clr)
void setMdiCaptionActiveBackColor (const QColor &clr)
void setMdiCaptionInactiveForeColor (const QColor &clr)
void setMdiCaptionInactiveBackColor (const QColor &clr)

Static Public Member Functions

void getCaptionColors (const QPalette &pal, QColor &activeBG, QColor &activeFG, QColor &inactiveBG, QColor &inactiveFG)

Public Attributes

QPtrList< KMdiChildFrm > * m_pZ
QSize m_defaultChildFrmSize

Protected Member Functions

void tileAllInternal (int maxWnds)
virtual void resizeEvent (QResizeEvent *)
void mousePressEvent (QMouseEvent *e)
void childMinimized (KMdiChildFrm *lpC, bool bWasMaximized)

Protected Attributes

QFont m_captionFont
QColor m_captionActiveBackColor
QColor m_captionActiveForeColor
QColor m_captionInactiveBackColor
QColor m_captionInactiveForeColor
int m_captionFontLineSpacing

Friends

class KMdiChildFrmCaption
class KMdiChildFrm

Detailed Description

Internal class.

The main frame widget KMdiMainFrm consists of 2 child widgets. One is this class. It's the widget where the child frames (emulated toplevel MDI views) live in. This class is the manager for the child frame widgets because it controls the Z-order widget stack of KMdiChildFrm's. It provides all placing and positioning algorithms for docked (attached) MDI views.

KMdiChildArea doesn't know anything about the actual MDI views. It only knows and manages the frame widgets of attached MDI views. All actions and stuff concerning only to childframes are handled here.

Definition at line 52 of file kmdichildarea.h.


Constructor & Destructor Documentation

KMdiChildArea::KMdiChildArea QWidget parent  ) 
 

Consruction.

Note: This class needn't to know about KMdiMainFrm .

Definition at line 46 of file kmdichildarea.cpp.

References getCaptionColors(), QFontMetrics::lineSpacing(), m_captionActiveBackColor, m_captionActiveForeColor, m_captionFont, m_captionInactiveBackColor, m_captionInactiveForeColor, m_defaultChildFrmSize, m_pZ, QPtrList< KMdiChildFrm >::setAutoDelete(), and QFrame::setFrameStyle().

KMdiChildArea::~KMdiChildArea  ) 
 

Destructor : THERE should be no child windows anymore...

Howewer it simply deletes all the child widgets :)

Definition at line 67 of file kmdichildarea.cpp.

References m_pZ.


Member Function Documentation

void KMdiChildArea::manageChild KMdiChildFrm lpC,
bool  bShow = true,
bool  bCascade = true
 

Appends a new KMdiChildFrm to this manager.

The child is shown,raised and gets focus if this window has it.

Definition at line 74 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::append(), QPtrList< KMdiChildFrm >::count(), QPtrList< KMdiChildFrm >::findNext(), QPtrList< KMdiChildFrm >::findRef(), focusTopChild(), getCascadePoint(), QPtrList< KMdiChildFrm >::insert(), m_pZ, KMdiChildFrm::setState(), KMdiChildFrm::state(), sysButtonConnectionsMustChange(), QPtrList< KMdiChildFrm >::take(), and topChild().

Referenced by KMdiMainFrm::attachWindow().

void KMdiChildArea::destroyChild KMdiChildFrm lpC,
bool  bFocusTopChild = true
 

Destroys a KMdiChildFrm managed.
Note that if a client is attached to this child , it is deleted too!

Definition at line 104 of file kmdichildarea.cpp.

References QObject::disconnect(), focusTopChild(), m_pZ, noMaximizedChildFrmLeft(), QPtrList< KMdiChildFrm >::removeRef(), QPtrList< KMdiChildFrm >::setAutoDelete(), KMdiChildFrm::setState(), KMdiChildFrm::state(), sysButtonConnectionsMustChange(), and topChild().

Referenced by KMdiMainFrm::closeWindow().

void KMdiChildArea::destroyChildButNotItsView KMdiChildFrm lpC,
bool  bFocusTopChild = true
 

Destroys a KMdiChildFrm managed.
Note that if a client is attached to this child , it is NOT deleted!

Definition at line 134 of file kmdichildarea.cpp.

References QObject::disconnect(), focusTopChild(), m_pZ, noMaximizedChildFrmLeft(), QPtrList< KMdiChildFrm >::removeRef(), QPtrList< KMdiChildFrm >::setAutoDelete(), KMdiChildFrm::setState(), KMdiChildFrm::state(), sysButtonConnectionsMustChange(), topChild(), and KMdiChildFrm::unsetClient().

Referenced by KMdiMainFrm::detachWindow(), and KMdiMainFrm::removeWindowFromMdi().

void KMdiChildArea::setTopChild KMdiChildFrm lpC,
bool  bSetFocus = false
 

Brings the child lpC to the top of the stack The children is focused if bSetFocus is true otherwise is raised only.

:

Definition at line 164 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::append(), QPtrList< KMdiChildFrm >::first(), QPtrList< KMdiChildFrm >::last(), KMdiChildFrm::m_pCaption, KMdiChildFrm::m_pClient, m_pZ, KMdiChildFrm::m_state, QWidget::minimumHeight(), QWidget::minimumWidth(), QPtrList< KMdiChildFrm >::next(), QPtrList< KMdiChildFrm >::removeRef(), KMdiChildFrmCaption::setActive(), QPtrList< KMdiChildFrm >::setAutoDelete(), QWidget::setFocus(), QFocusEvent::setReason(), KMdiChildFrm::setState(), and sysButtonConnectionsMustChange().

Referenced by KMdiMainFrm::activateView(), KMdiChildFrm::mousePressEvent(), and KMdiChildFrm::raiseAndActivate().

KMdiChildFrm* KMdiChildArea::topChild  )  const [inline]
 

Returns the topmost child (the active one) or 0 if there are no children.

Note that the topmost child may be also hidded , if ALL the windows are minimized.

Definition at line 133 of file kmdichildarea.h.

References QPtrList< KMdiChildFrm >::last(), and m_pZ.

Referenced by KMdiMainFrm::activateView(), KMdiMainFrm::attachWindow(), KMdiMainFrm::closeWindow(), destroyChild(), destroyChildButNotItsView(), KMdiMainFrm::eventFilter(), manageChild(), KMdiMainFrm::removeWindowFromMdi(), KMdiChildFrm::setClient(), KMdiMainFrm::setEnableMaximizedChildFrmMode(), KMdiChildFrm::setState(), tileAllInternal(), tileAnodine(), tileVertically(), and KMdiMainFrm::windowMenuItemActivated().

int KMdiChildArea::getVisibleChildCount  )  const
 

Returns the number of visible children.

Definition at line 400 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::first(), m_pZ, KMdiChildFrm::m_state, and QPtrList< KMdiChildFrm >::next().

Referenced by KMdiMainFrm::closeWindow(), KMdiMainFrm::removeWindowFromMdi(), tileAllInternal(), tileAnodine(), and tileVertically().

QPoint KMdiChildArea::getCascadePoint int  indexOfWindow = -1  ) 
 

Calculates the cascade point for the given index.

If index is -1 the cascade point is calculated for the window following the last window

Definition at line 246 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::count(), QApplication::desktop(), QPtrList< KMdiChildFrm >::first(), QSize::height(), KMdiChildFrmCaption::heightHint(), m_defaultChildFrmSize, KMdiChildFrm::m_pCaption, m_pZ, QPoint::setX(), QPoint::setY(), and QSize::width().

Referenced by KMdiMainFrm::addWindow(), cascadeMaximized(), cascadeWindows(), KMdiMainFrm::detachWindow(), and manageChild().

void KMdiChildArea::setMdiCaptionFont const QFont fnt  ) 
 

Sets the MDI childframe window caption font (no relayout).

Definition at line 590 of file kmdichildarea.cpp.

References KMdiChildFrm::doResize(), QPtrList< KMdiChildFrm >::first(), QFontMetrics::lineSpacing(), m_captionFont, m_pZ, and QPtrList< KMdiChildFrm >::next().

void KMdiChildArea::setMdiCaptionActiveForeColor const QColor clr  ) 
 

Sets the foreground color of the active MDI childframe window caption (no relayout).

Definition at line 601 of file kmdichildarea.cpp.

References m_captionActiveForeColor.

void KMdiChildArea::setMdiCaptionActiveBackColor const QColor clr  ) 
 

Sets the background color of the active MDI childframe window captions (no relayout).

Definition at line 606 of file kmdichildarea.cpp.

References m_captionActiveBackColor.

void KMdiChildArea::setMdiCaptionInactiveForeColor const QColor clr  ) 
 

Sets the foreground color of inactive MDI childframe window captions (no relayout).

Definition at line 611 of file kmdichildarea.cpp.

References m_captionInactiveForeColor.

void KMdiChildArea::setMdiCaptionInactiveBackColor const QColor clr  ) 
 

Sets the background color of inactive MDI childframe window captions (no relayout).

Definition at line 616 of file kmdichildarea.cpp.

References m_captionInactiveBackColor.

void KMdiChildArea::getCaptionColors const QPalette pal,
QColor activeBG,
QColor activeFG,
QColor inactiveBG,
QColor inactiveFG
[static]
 

Gets all caption colors, consistent with current WM settings (or other Desktop settings e.g.

system settings for win32). This method is useful not only for KMDI child windows. Colors are returned via activeBG, activeFG, inactiveBG, inactiveFG references.

Definition at line 645 of file kmdichildarea.cpp.

References QPalette::active(), QApplication::desktopSettingsAware(), and QPalette::inactive().

Referenced by KMdiChildArea().

void KMdiChildArea::cascadeWindows  )  [slot]
 

Cascades the windows resizing it to the minimum size.

Definition at line 322 of file kmdichildarea.cpp.

References QPtrList::first(), focusTopChild(), getCascadePoint(), QPtrList::isEmpty(), m_pZ, KMdiChildFrm::m_state, QPtrList::removeFirst(), KMdiChildFrm::restorePressed(), and QPtrList::setAutoDelete().

Referenced by KMdiMainFrm::cascadeWindows().

void KMdiChildArea::cascadeMaximized  )  [slot]
 

Casecades the windows resizing it to the maximum available size.

Definition at line 341 of file kmdichildarea.cpp.

References QPtrList::first(), focusTopChild(), getCascadePoint(), QSize::height(), QPtrList::isEmpty(), m_pZ, KMdiChildFrm::m_state, QPtrList::removeFirst(), KMdiChildFrm::restorePressed(), QPtrList::setAutoDelete(), QSize::width(), QPoint::x(), and QPoint::y().

Referenced by KMdiMainFrm::cascadeMaximized().

void KMdiChildArea::expandVertical  )  [slot]
 

Maximize all windows but only in vertical direction.

Definition at line 364 of file kmdichildarea.cpp.

References QPtrList::first(), focusTopChild(), QPtrList::isEmpty(), m_pZ, KMdiChildFrm::m_state, QPtrList::removeFirst(), KMdiChildFrm::restorePressed(), and QPtrList::setAutoDelete().

Referenced by KMdiMainFrm::expandVertical().

void KMdiChildArea::expandHorizontal  )  [slot]
 

Maximize all windows but only in horizontal direction.

Definition at line 381 of file kmdichildarea.cpp.

References QPtrList::first(), focusTopChild(), QPtrList::isEmpty(), m_pZ, KMdiChildFrm::m_state, QPtrList::removeFirst(), KMdiChildFrm::restorePressed(), and QPtrList::setAutoDelete().

Referenced by KMdiMainFrm::expandHorizontal().

void KMdiChildArea::focusTopChild  )  [slot]
 

Foces focus to the topmost child In case that it not gets focused automatically...

Btw : It should not happen.

Definition at line 303 of file kmdichildarea.cpp.

References KMdiChildView::activate(), QPtrList< KMdiChildFrm >::first(), QWidget::hasFocus(), QPtrList< KMdiChildFrm >::last(), lastChildFrmClosed(), KMdiChildFrm::m_pCaption, KMdiChildFrm::m_pClient, m_pZ, QPtrList< KMdiChildFrm >::next(), and KMdiChildFrmCaption::setActive().

Referenced by cascadeMaximized(), cascadeWindows(), childMinimized(), destroyChild(), destroyChildButNotItsView(), KMdiMainFrm::eventFilter(), expandHorizontal(), expandVertical(), and manageChild().

void KMdiChildArea::tilePragma  )  [slot]
 

Tile Pragma.

Definition at line 412 of file kmdichildarea.cpp.

References tileAllInternal().

Referenced by KMdiMainFrm::tilePragma().

void KMdiChildArea::tileAnodine  )  [slot]
 

Tile Anodine.

Definition at line 484 of file kmdichildarea.cpp.

References KMdiChildView::activate(), QPtrList< KMdiChildFrm >::first(), getVisibleChildCount(), KMdiChildFrm::m_pClient, m_pZ, KMdiChildFrm::m_state, QPtrList< KMdiChildFrm >::next(), KMdiChildFrm::restorePressed(), and topChild().

Referenced by KMdiMainFrm::tileAnodine().

void KMdiChildArea::tileVertically  )  [slot]
 

Tile Vertically.

Definition at line 536 of file kmdichildarea.cpp.

References KMdiChildView::activate(), QPtrList< KMdiChildFrm >::first(), getVisibleChildCount(), KMdiChildFrm::m_pClient, m_pZ, KMdiChildFrm::m_state, QPtrList< KMdiChildFrm >::next(), KMdiChildFrm::restorePressed(), and topChild().

Referenced by KMdiMainFrm::tileVertically().

void KMdiChildArea::layoutMinimizedChildren  )  [slot]
 

Positioning of minimized child frames.

Definition at line 571 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::first(), m_pZ, QPtrList< KMdiChildFrm >::next(), and KMdiChildFrm::state().

Referenced by resizeEvent(), and KMdiChildFrm::switchToMinimizeLayout().

void KMdiChildArea::tileAllInternal int  maxWnds  )  [protected]
 

Internally used for the tile algorithm.

Definition at line 419 of file kmdichildarea.cpp.

References KMdiChildView::activate(), QPtrList< KMdiChildFrm >::first(), getVisibleChildCount(), QSize::height(), m_defaultChildFrmSize, KMdiChildFrm::m_pClient, m_pZ, KMdiChildFrm::m_state, QPtrList< KMdiChildFrm >::next(), KMdiChildFrm::restorePressed(), topChild(), and QSize::width().

Referenced by tilePragma().

void KMdiChildArea::resizeEvent QResizeEvent  )  [protected, virtual]
 

Automatically resizes a maximized MDI view and layouts the positions of minimized MDI views.

Reimplemented from QFrame.

Definition at line 216 of file kmdichildarea.cpp.

References QWidget::height(), KMdiChildFrmCaption::heightHint(), QPtrList< KMdiChildFrm >::last(), layoutMinimizedChildren(), KMdiChildFrm::m_pCaption, KMdiChildFrm::m_pClient, m_pZ, KMdiChildFrm::m_state, QWidget::resizeEvent(), and QWidget::width().

void KMdiChildArea::mousePressEvent QMouseEvent e  )  [protected]
 

Shows the 'Window' popup menu on right mouse button click.

Definition at line 237 of file kmdichildarea.cpp.

References QMouseEvent::button(), popupWindowMenu(), and QMouseEvent::pos().

void KMdiChildArea::childMinimized KMdiChildFrm lpC,
bool  bWasMaximized
[protected]
 

Internally used.

Actions that are necessary when an MDI view gets minimized

Definition at line 280 of file kmdichildarea.cpp.

References QPtrList< KMdiChildFrm >::count(), QPtrList< KMdiChildFrm >::findRef(), focusTopChild(), QPtrList< KMdiChildFrm >::insert(), QPtrList< KMdiChildFrm >::last(), m_pZ, KMdiChildFrm::m_state, QPtrList< KMdiChildFrm >::removeRef(), QPtrList< KMdiChildFrm >::setAutoDelete(), and KMdiChildFrm::setState().

Referenced by KMdiChildFrm::setState().

void KMdiChildArea::noMaximizedChildFrmLeft KMdiChildFrm  )  [signal]
 

Signalizes that there aren't maximized child frames any more.

Referenced by destroyChild(), and destroyChildButNotItsView().

void KMdiChildArea::nowMaximized bool   )  [signal]
 

Signalizes that the child frames are maximized now.

Referenced by KMdiChildFrm::maximizePressed(), KMdiChildFrm::minimizePressed(), and KMdiChildFrm::restorePressed().

void KMdiChildArea::sysButtonConnectionsMustChange KMdiChildFrm ,
KMdiChildFrm
[signal]
 

Internally used.

Signalizes from KMdiChildArea to KMdiMainFrm that the signal/slot connections of the system buttons in the menubar (only in Maximize mode) must be updated to another MDI view because the focused MDI view has changed

Referenced by destroyChild(), destroyChildButNotItsView(), manageChild(), and setTopChild().

void KMdiChildArea::popupWindowMenu QPoint   )  [signal]
 

Internally used.

Signalizes from KMdiChildArea to KMdiMainFrm that the 'Window' popup menu must be shown

Referenced by mousePressEvent().

void KMdiChildArea::lastChildFrmClosed  )  [signal]
 

Signalizes that the last attached (docked) MDI view has been closed.

Note: Detached MDI views can remain.

Referenced by focusTopChild().


Member Data Documentation

QPtrList<KMdiChildFrm>* KMdiChildArea::m_pZ
 

Z Order stack of KMdiChildFrm childframe windows (top=last).

Definition at line 64 of file kmdichildarea.h.

Referenced by cascadeMaximized(), cascadeWindows(), childMinimized(), destroyChild(), destroyChildButNotItsView(), expandHorizontal(), expandVertical(), focusTopChild(), getCascadePoint(), getVisibleChildCount(), KMdiChildArea(), layoutMinimizedChildren(), manageChild(), resizeEvent(), setMdiCaptionFont(), setTopChild(), tileAllInternal(), tileAnodine(), tileVertically(), topChild(), and ~KMdiChildArea().

QSize KMdiChildArea::m_defaultChildFrmSize
 

the default size of an newly created childframe

Definition at line 68 of file kmdichildarea.h.

Referenced by KMdiMainFrm::defaultChildFrmSize(), getCascadePoint(), KMdiChildArea(), KMdiChildFrm::setClient(), KMdiMainFrm::setDefaultChildFrmSize(), and tileAllInternal().

QFont KMdiChildArea::m_captionFont [protected]
 

The MDI childframe window caption font.

Definition at line 74 of file kmdichildarea.h.

Referenced by KMdiChildArea(), KMdiChildFrmCaption::paintEvent(), and setMdiCaptionFont().

QColor KMdiChildArea::m_captionActiveBackColor [protected]
 

The foreground color of the active MDI childframe window caption.

Definition at line 78 of file kmdichildarea.h.

Referenced by KMdiChildArea(), KMdiChildFrmCaption::paintEvent(), KMdiChildFrmCaption::setActive(), and setMdiCaptionActiveBackColor().

QColor KMdiChildArea::m_captionActiveForeColor [protected]
 

The background color of the active MDI childframe window captions.

Definition at line 82 of file kmdichildarea.h.

Referenced by KMdiChildArea(), KMdiChildFrmCaption::paintEvent(), and setMdiCaptionActiveForeColor().

QColor KMdiChildArea::m_captionInactiveBackColor [protected]
 

The foreground color of inactive MDI childframe window captions.

Definition at line 86 of file kmdichildarea.h.

Referenced by KMdiChildArea(), KMdiChildFrmCaption::paintEvent(), KMdiChildFrmCaption::setActive(), and setMdiCaptionInactiveBackColor().

QColor KMdiChildArea::m_captionInactiveForeColor [protected]
 

The background color of inactive MDI childframe window captions.

Definition at line 90 of file kmdichildarea.h.

Referenced by KMdiChildArea(), KMdiChildFrmCaption::paintEvent(), and setMdiCaptionInactiveForeColor().


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:18:07 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003