Logo Search packages:      
Sourcecode: kbear version File versions  Download package

void QextMdiMainFrm::setMenuForSDIModeSysButtons ( KMenuBar *  pMenuBar = 0  )  [virtual]

Tells the MDI system a QMenu where it can insert buttons for the system menu, undock, minimize, restore actions. If no such menu is given, QextMDI simply overlays the buttons at the upper right-hand side of the main widget.

redirect the signal for insertion of buttons to an own slot that means: If the menubar (where the buttons should be inserted) is given, QextMDI can insert them automatically. Otherwise only signals can be emitted to tell the outside that someone must do this job itself.

Definition at line 1335 of file qextmdimainfrm.cpp.

References frameDecorOfAttachedViews(), and setSysButtonsAtMenuPosition().

Referenced by setFrameDecorOfAttachedViews().

{
   if (m_bSDIApplication)  // there are no buttons in the menubar in this mode (although the view is always maximized)
      return;

   m_pMainMenuBar = pMenuBar;
   if( m_pMainMenuBar == 0L)
      return;  // use setMenuForSDIModeSysButtons( 0L) for unsetting the external main menu!

   if (!m_pUndock)
      m_pUndock = new QToolButton( pMenuBar);
   if (!m_pRestore)
      m_pRestore = new QToolButton( pMenuBar);
   if (!m_pMinimize)
      m_pMinimize = new QToolButton( pMenuBar);
   if (!m_pClose)
      m_pClose = new QToolButton( pMenuBar);
   m_pUndock->setAutoRaise(FALSE);
   m_pMinimize->setAutoRaise(FALSE);
   m_pRestore->setAutoRaise(FALSE);
   m_pClose->setAutoRaise(FALSE);

   setSysButtonsAtMenuPosition();

   delete m_pUndockButtonPixmap;
   delete m_pMinButtonPixmap;
   delete m_pRestoreButtonPixmap;
   delete m_pCloseButtonPixmap;
   // create the decoration pixmaps
   if (frameDecorOfAttachedViews() == QextMdi::Win95Look) {
      m_pUndockButtonPixmap = new QPixmap( win_undockbutton);
      m_pMinButtonPixmap = new QPixmap( win_minbutton);
      m_pRestoreButtonPixmap = new QPixmap( win_restorebutton);
      m_pCloseButtonPixmap = new QPixmap( win_closebutton);
   }
   else if (frameDecorOfAttachedViews() == QextMdi::KDE1Look) {
      m_pUndockButtonPixmap = new QPixmap( kde_undockbutton);
      m_pMinButtonPixmap = new QPixmap( kde_minbutton);
      m_pRestoreButtonPixmap = new QPixmap( kde_restorebutton);
      m_pCloseButtonPixmap = new QPixmap( kde_closebutton);
#if QT_VERSION > 209
      m_pUndock->setAutoRaise(TRUE);
      m_pMinimize->setAutoRaise(TRUE);
      m_pRestore->setAutoRaise(TRUE);
      m_pClose->setAutoRaise(TRUE);
#endif
   }
   else if (frameDecorOfAttachedViews() == QextMdi::KDE2Look) {
      m_pUndockButtonPixmap = new QPixmap( kde2_undockbutton);
      m_pMinButtonPixmap = new QPixmap( kde2_minbutton);
      m_pRestoreButtonPixmap = new QPixmap( kde2_restorebutton);
      m_pCloseButtonPixmap = new QPixmap( kde2_closebutton);
   }
   else {   // kde2laptop look
      m_pUndockButtonPixmap = new QPixmap( kde2laptop_undockbutton);
      m_pMinButtonPixmap = new QPixmap( kde2laptop_minbutton);
      m_pRestoreButtonPixmap = new QPixmap( kde2laptop_restorebutton);
      m_pCloseButtonPixmap = new QPixmap( kde2laptop_closebutton);
   }

   m_pUndock->hide();
   m_pMinimize->hide();
   m_pRestore->hide();
   m_pClose->hide();
   
   m_pUndock->setPixmap( *m_pUndockButtonPixmap);
   m_pMinimize->setPixmap( *m_pMinButtonPixmap);
   m_pRestore->setPixmap( *m_pRestoreButtonPixmap);
   m_pClose->setPixmap( *m_pCloseButtonPixmap);
}


Generated by  Doxygen 1.6.0   Back to index