kmdi Library API Documentation

KMdiTaskBar Class Reference

Internal class. More...

#include <kmditaskbar.h>

Collaboration diagram for KMdiTaskBar:

Collaboration graph
[legend]
List of all members.

Public Slots

void setActiveButton (KMdiChildView *win_ptr)

Public Member Functions

 KMdiTaskBar (KMdiMainFrm *parent, QMainWindow::ToolBarDock dock)
 ~KMdiTaskBar ()
KMdiTaskBarButtonaddWinButton (KMdiChildView *win_ptr)
void removeWinButton (KMdiChildView *win_ptr, bool haveToLayoutTaskBar=true)
KMdiTaskBarButtongetNextWindowButton (bool bRight, KMdiChildView *win_ptr)
KMdiTaskBarButtongetButton (KMdiChildView *win_ptr)
void switchOn (bool bOn)
bool isSwitchedOn () const

Protected Slots

void layoutTaskBar (int taskBarWidth=0)

Protected Member Functions

void resizeEvent (QResizeEvent *)

Protected Attributes

QPtrList< KMdiTaskBarButton > * m_pButtonList
KMdiMainFrmm_pFrm
KMdiChildViewm_pCurrentFocusedWindow
QLabelm_pStretchSpace
bool m_layoutIsPending
bool m_bSwitchedOn

Detailed Description

Internal class.

It's a special kind of QToolBar that acts as taskbar for child views. KMdiTaskBarButtons can be added or removed dynamically.
The button sizes are adjusted dynamically, as well.

Definition at line 129 of file kmditaskbar.h.


Constructor & Destructor Documentation

KMdiTaskBar::KMdiTaskBar KMdiMainFrm parent,
QMainWindow::ToolBarDock  dock
 

Constructor (NoFocus, minimum width = 1, an internal QPtrList of taskbar buttons (autodelete)).

Definition at line 143 of file kmditaskbar.cpp.

References KMdiTaskBar(), m_pButtonList, m_pFrm, and QPtrList< KMdiTaskBarButton >::setAutoDelete().

Referenced by KMdiTaskBar().

KMdiTaskBar::~KMdiTaskBar  ) 
 

Destructor (deletes the taskbar button list).

Definition at line 159 of file kmditaskbar.cpp.

References m_pButtonList.


Member Function Documentation

KMdiTaskBarButton * KMdiTaskBar::addWinButton KMdiChildView win_ptr  ) 
 

Add a new KMdiTaskBarButton .

The width doesn't change. If there's not enough space, all taskbar buttons will be resized to a new smaller size. Probably button texts must be abbreviated now.

Definition at line 164 of file kmditaskbar.cpp.

References addWinButton(), QPtrList< KMdiTaskBarButton >::append(), layoutTaskBar(), m_pButtonList, m_pFrm, m_pStretchSpace, setActiveButton(), QLabel::setText(), KMdiTaskBarButton::setText(), QPushButton::setToggleButton(), and KMdiChildView::tabCaption().

Referenced by addWinButton(), and KMdiMainFrm::addWindow().

void KMdiTaskBar::removeWinButton KMdiChildView win_ptr,
bool  haveToLayoutTaskBar = true
 

Removes a KMdiTaskBarButton and deletes it.

If the rest of the buttons are smaller than they usually are, all those buttons will be resized in a way that the new free size is used as well.

Definition at line 198 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::count(), getButton(), layoutTaskBar(), m_pButtonList, m_pStretchSpace, QPtrList< KMdiTaskBarButton >::removeRef(), and removeWinButton().

Referenced by KMdiMainFrm::closeWindow(), removeWinButton(), and KMdiMainFrm::removeWindowFromMdi().

KMdiTaskBarButton * KMdiTaskBar::getNextWindowButton bool  bRight,
KMdiChildView win_ptr
 

Returns the neighbor taskbar button of the taskbar button of the MDI view given by parameter bRight specifies the side, of course left is used if bRight is false.

Definition at line 248 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::first(), getNextWindowButton(), QPtrList< KMdiTaskBarButton >::last(), m_pButtonList, KMdiTaskBarButton::m_pWindow, QPtrList< KMdiTaskBarButton >::next(), and QPtrList< KMdiTaskBarButton >::prev().

Referenced by getNextWindowButton().

KMdiTaskBarButton * KMdiTaskBar::getButton KMdiChildView win_ptr  ) 
 

Get the button belonging to the MDI view given as parameter.

Definition at line 238 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::first(), getButton(), m_pButtonList, KMdiTaskBarButton::m_pWindow, and QPtrList< KMdiTaskBarButton >::next().

Referenced by getButton(), removeWinButton(), and KMdiMainFrm::removeWindowFromMdi().

void KMdiTaskBar::switchOn bool  bOn  ) 
 

Switch it on or off.

Definition at line 218 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::count(), m_pButtonList, and switchOn().

Referenced by KMdiMainFrm::hideViewTaskBar(), KMdiMainFrm::showViewTaskBar(), KMdiMainFrm::slot_toggleTaskBar(), switchOn(), KMdiMainFrm::switchToIDEAlMode(), and KMdiMainFrm::switchToTabPageMode().

bool KMdiTaskBar::isSwitchedOn  )  const [inline]
 

Returns:
whether switched on or off.

Definition at line 168 of file kmditaskbar.h.

Referenced by KMdiMainFrm::isViewTaskBarOn(), and KMdiMainFrm::slot_toggleTaskBar().

void KMdiTaskBar::resizeEvent QResizeEvent  )  [protected]
 

Reimplemented from its base class to call layoutTaskBar, additionally.

Definition at line 378 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::count(), layoutTaskBar(), m_pButtonList, resizeEvent(), and QResizeEvent::size().

Referenced by resizeEvent().

void KMdiTaskBar::layoutTaskBar int  taskBarWidth = 0  )  [protected, slot]
 

Checks if all buttons fits into this.

If not, it recalculates all button widths in a way that all buttons fits into the taskbar and have got equal width. The text of the buttons will be abbreviated when nessecary, all buttons get a fixed width and show() is called for each one. If one drags the taskbar to a vertical orientation, the button width is set to 80 pixel.

Definition at line 306 of file kmditaskbar.cpp.

References KMdiTaskBarButton::actualText(), QPtrList< KMdiTaskBarButton >::count(), QPtrList< KMdiTaskBarButton >::first(), KMdiTaskBarButton::fitText(), QSize::height(), layoutTaskBar(), m_pButtonList, QPtrList< KMdiTaskBarButton >::next(), KMdiTaskBarButton::setText(), QFontMetrics::size(), and QSize::width().

Referenced by addWinButton(), layoutTaskBar(), removeWinButton(), and resizeEvent().

void KMdiTaskBar::setActiveButton KMdiChildView win_ptr  )  [slot]
 

Pushes the desired taskbar button down (switch on), the old one is released (switched off).

Actually it's a radiobutton group behavior.

Definition at line 285 of file kmditaskbar.cpp.

References QPtrList< KMdiTaskBarButton >::first(), m_pButtonList, m_pCurrentFocusedWindow, KMdiTaskBarButton::m_pWindow, QPtrList< KMdiTaskBarButton >::next(), setActiveButton(), and QPushButton::toggle().

Referenced by KMdiMainFrm::activateView(), addWinButton(), and setActiveButton().


Member Data Documentation

QPtrList<KMdiTaskBarButton>* KMdiTaskBar::m_pButtonList [protected]
 

A list of taskbar buttons.

Note: Each button stands for one MDI view (toolviews doesn't have got a taskbar button).

Definition at line 197 of file kmditaskbar.h.

Referenced by addWinButton(), getButton(), getNextWindowButton(), KMdiTaskBar(), layoutTaskBar(), removeWinButton(), resizeEvent(), setActiveButton(), switchOn(), and ~KMdiTaskBar().

KMdiMainFrm* KMdiTaskBar::m_pFrm [protected]
 

The belonging MDI mainframe (parent widget of this).

Definition at line 201 of file kmditaskbar.h.

Referenced by addWinButton(), and KMdiTaskBar().

KMdiChildView* KMdiTaskBar::m_pCurrentFocusedWindow [protected]
 

The MDI view belonging to the currently pressed taskbar button.

Definition at line 205 of file kmditaskbar.h.

Referenced by setActiveButton().

QLabel* KMdiTaskBar::m_pStretchSpace [protected]
 

A stretchable widget used as 'space' at the end of a half filled taskbar.

Definition at line 209 of file kmditaskbar.h.

Referenced by addWinButton(), and removeWinButton().


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.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Apr 12 23:30:12 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003