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

void QextMdiMainFrm::setEnableMaximizedChildFrmMode ( bool  bEnable  )  [virtual, slot]

If in Childframe mode, we can switch between maximized or restored shown MDI views

turns the system buttons for maximize mode (SDI mode) on, and connects them with the current child frame

Definition at line 1500 of file qextmdimainfrm.cpp.

References frameDecorOfAttachedViews(), QextMdiChildFrm::m_pClient, QextMdiChildView::restore(), QextMdiChildFrm::state(), switchOffMaximizeModeForMenu(), and QextMdiChildArea::topChild().

Referenced by KBear::applyWindowSettings(), and createMdiManager().

{
   if (bEnable) {
      m_bMaximizedChildFrmMode = TRUE;
      //qDebug("MaximizeMode on");

      QextMdiChildFrm* pCurrentChild = m_pMdi->topChild();
      if( !pCurrentChild)
         return;

      // if there is no menubar given, those system buttons aren't possible
      if( m_pMainMenuBar == 0L)
         return;
      QObject::connect( m_pUndock, SIGNAL(clicked()), pCurrentChild, SLOT(undockPressed()) );
      m_pUndock->show();
      QObject::connect( m_pMinimize, SIGNAL(clicked()), pCurrentChild, SLOT(minimizePressed()) );
      m_pMinimize->show();
      QObject::connect( m_pRestore, SIGNAL(clicked()), pCurrentChild, SLOT(maximizePressed()) );
      m_pRestore->show();

      if (frameDecorOfAttachedViews() == QextMdi::KDE2LaptopLook) {
         m_pMainMenuBar->insertItem( QPixmap(kde2laptop_closebutton_menu), m_pMdi->topChild(), SLOT(closePressed()), 0, -1, 0);
      }
      else {
/* changed by kbjorn
         m_pMainMenuBar->insertItem( *pCurrentChild->icon(), pCurrentChild->systemMenu(), -1, 0);
*/
         QObject::connect( m_pClose, SIGNAL(clicked()), pCurrentChild, SLOT(closePressed()) );
         m_pClose->show();
      }
   }
   else {
      if (!m_bMaximizedChildFrmMode) return;  // already set, nothing to do

      m_bMaximizedChildFrmMode = FALSE;
      //qDebug("MaximizeMode off");

      QextMdiChildFrm* pFrmChild = m_pMdi->topChild();
      if (!pFrmChild) return;

      if (pFrmChild->m_pClient && pFrmChild->state() == QextMdiChildFrm::Maximized) {
         pFrmChild->m_pClient->restore();
         switchOffMaximizeModeForMenu( pFrmChild);
      }
   }
}


Generated by  Doxygen 1.6.0   Back to index