@ -136,8 +136,8 @@ public:
} ;
} ;
//============ constructor ============//
//============ constructor ============//
KMdiMainFrm : : KMdiMainFrm ( TQWidget * tq parentWidget, const char * name , KMdi : : MdiMode mdiMode , WFlags flags )
KMdiMainFrm : : KMdiMainFrm ( TQWidget * parentWidget, const char * name , KMdi : : MdiMode mdiMode , WFlags flags )
: KParts : : DockMainWindow ( tq parentWidget, name , flags )
: KParts : : DockMainWindow ( parentWidget, name , flags )
, m_mdiMode ( KMdi : : UndefinedMode )
, m_mdiMode ( KMdi : : UndefinedMode )
, m_pMdi ( 0L )
, m_pMdi ( 0L )
, m_pTaskBar ( 0L )
, m_pTaskBar ( 0L )
@ -294,7 +294,7 @@ void KMdiMainFrm::setStandardMDIMenuEnabled( bool showModeMenu )
//============ ~KMdiMainFrm ============//
//============ ~KMdiMainFrm ============//
KMdiMainFrm : : ~ KMdiMainFrm ( )
KMdiMainFrm : : ~ KMdiMainFrm ( )
{
{
//save the children first to a list, as removing tq invalidates our iterator
//save the children first to a list, as removing invalidates our iterator
TQValueList < KMdiChildView * > children ;
TQValueList < KMdiChildView * > children ;
for ( KMdiChildView * w = m_pDocumentViews - > first ( ) ; w ; w = m_pDocumentViews - > next ( ) )
for ( KMdiChildView * w = m_pDocumentViews - > first ( ) ; w ; w = m_pDocumentViews - > next ( ) )
children . append ( w ) ;
children . append ( w ) ;
@ -391,7 +391,7 @@ void KMdiMainFrm::slot_toggleTaskBar()
void KMdiMainFrm : : resizeEvent ( TQResizeEvent * e )
void KMdiMainFrm : : resizeEvent ( TQResizeEvent * e )
{
{
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! tq parentWidget( ) )
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! parentWidget( ) )
{
{
if ( e - > oldSize ( ) . height ( ) ! = e - > size ( ) . height ( ) )
if ( e - > oldSize ( ) . height ( ) ! = e - > size ( ) . height ( ) )
return ;
return ;
@ -406,7 +406,7 @@ void KMdiMainFrm::resizeEvent( TQResizeEvent *e )
void KMdiMainFrm : : setMinimumSize ( int minw , int minh )
void KMdiMainFrm : : setMinimumSize ( int minw , int minh )
{
{
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! tq parentWidget( ) )
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! parentWidget( ) )
return ;
return ;
DockMainWindow : : setMinimumSize ( minw , minh ) ;
DockMainWindow : : setMinimumSize ( minw , minh ) ;
}
}
@ -627,7 +627,7 @@ void KMdiMainFrm::attachWindow( KMdiChildView *pWnd, bool bShow, bool bAutomatic
lpC - > setClient ( pWnd , bAutomaticResize ) ;
lpC - > setClient ( pWnd , bAutomaticResize ) ;
lpC - > setFocus ( ) ;
lpC - > setFocus ( ) ;
pWnd - > youAreAttached ( lpC ) ;
pWnd - > youAreAttached ( lpC ) ;
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! tq parentWidget( ) )
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! parentWidget( ) )
{
{
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
@ -772,12 +772,12 @@ void KMdiMainFrm::removeWindowFromMdi( KMdiChildView *pWnd )
m_pDockbaseOfTabPage = m_pDockbaseAreaOfDocumentViews ;
m_pDockbaseOfTabPage = m_pDockbaseAreaOfDocumentViews ;
m_pClose - > hide ( ) ;
m_pClose - > hide ( ) ;
}
}
KDockWidget * pDockW = ( KDockWidget * ) pWnd - > tq parentWidget( ) ;
KDockWidget * pDockW = ( KDockWidget * ) pWnd - > parentWidget( ) ;
pWnd - > reparent ( 0L , TQPoint ( 0 , 0 ) ) ;
pWnd - > reparent ( 0L , TQPoint ( 0 , 0 ) ) ;
pDockW - > setWidget ( 0L ) ;
pDockW - > setWidget ( 0L ) ;
if ( pDockW = = m_pDockbaseOfTabPage )
if ( pDockW = = m_pDockbaseOfTabPage )
{
{
TQTabWidget * pTab = ( TQTabWidget * ) pDockW - > tq parentWidget( ) - > tq parentWidget( ) ;
TQTabWidget * pTab = ( TQTabWidget * ) pDockW - > parentWidget( ) - > parentWidget( ) ;
int cnt = pTab - > count ( ) ;
int cnt = pTab - > count ( ) ;
m_pDockbaseOfTabPage = ( KDockWidget * ) pTab - > page ( cnt - 2 ) ;
m_pDockbaseOfTabPage = ( KDockWidget * ) pTab - > page ( cnt - 2 ) ;
if ( pDockW = = m_pDockbaseOfTabPage )
if ( pDockW = = m_pDockbaseOfTabPage )
@ -874,12 +874,12 @@ void KMdiMainFrm::closeWindow( KMdiChildView *pWnd, bool layoutTaskBar )
m_pClose - > hide ( ) ;
m_pClose - > hide ( ) ;
}
}
#if 0
#if 0
KDockWidget * pDockW = ( KDockWidget * ) pWnd - > tq parentWidget( ) ;
KDockWidget * pDockW = ( KDockWidget * ) pWnd - > parentWidget( ) ;
pWnd - > reparent ( 0L , TQPoint ( 0 , 0 ) ) ;
pWnd - > reparent ( 0L , TQPoint ( 0 , 0 ) ) ;
pDockW - > setWidget ( 0L ) ;
pDockW - > setWidget ( 0L ) ;
if ( pDockW = = m_pDockbaseOfTabPage )
if ( pDockW = = m_pDockbaseOfTabPage )
{
{
TQTabWidget * pTab = ( TQTabWidget * ) pDockW - > tq parentWidget( ) - > tq parentWidget( ) ;
TQTabWidget * pTab = ( TQTabWidget * ) pDockW - > parentWidget( ) - > parentWidget( ) ;
int cnt = pTab - > count ( ) ;
int cnt = pTab - > count ( ) ;
m_pDockbaseOfTabPage = ( KDockWidget * ) pTab - > page ( cnt - 2 ) ;
m_pDockbaseOfTabPage = ( KDockWidget * ) pTab - > page ( cnt - 2 ) ;
if ( pDockW = = m_pDockbaseOfTabPage )
if ( pDockW = = m_pDockbaseOfTabPage )
@ -1234,7 +1234,7 @@ bool KMdiMainFrm::eventFilter( TQObject * /*obj*/, TQEvent *e )
*/
*/
void KMdiMainFrm : : closeAllViews ( )
void KMdiMainFrm : : closeAllViews ( )
{
{
//save the children first to a list, as removing tq invalidates our iterator
//save the children first to a list, as removing invalidates our iterator
TQValueList < KMdiChildView * > children ;
TQValueList < KMdiChildView * > children ;
for ( KMdiChildView * w = m_pDocumentViews - > first ( ) ; w ; w = m_pDocumentViews - > next ( ) )
for ( KMdiChildView * w = m_pDocumentViews - > first ( ) ; w ; w = m_pDocumentViews - > next ( ) )
{
{
@ -1302,7 +1302,7 @@ void KMdiMainFrm::findRootDockWidgets( TQPtrList<KDockWidget>* rootDockWidgetLis
if ( undockCandidate - > enableDocking ( ) ! = KDockWidget : : DockNone )
if ( undockCandidate - > enableDocking ( ) ! = KDockWidget : : DockNone )
rootDockWindow = undockCandidate ;
rootDockWindow = undockCandidate ;
}
}
pW = pW - > tq parentWidget( ) ;
pW = pW - > parentWidget( ) ;
}
}
if ( rootDockWindow )
if ( rootDockWindow )
@ -1395,7 +1395,7 @@ void KMdiMainFrm::switchToToplevelMode()
setMainDockWidget ( m_pDockbaseAreaOfDocumentViews ) ;
setMainDockWidget ( m_pDockbaseAreaOfDocumentViews ) ;
}
}
// TQApplication::sendPostedEvents(); //why do we need to empty the event queue?
// TQApplication::sendPostedEvents(); //why do we need to empty the event queue?
if ( ! tq parentWidget( ) )
if ( ! parentWidget( ) )
{
{
//if we don't have a parent widget ( which i expect we wouldn't )
//if we don't have a parent widget ( which i expect we wouldn't )
//make sure we take into account the size of the docks provided by
//make sure we take into account the size of the docks provided by
@ -1556,7 +1556,7 @@ void KMdiMainFrm::switchToChildframeMode()
if ( ! pView - > isToolView ( ) )
if ( ! pView - > isToolView ( ) )
pView - > show ( ) ;
pView - > show ( ) ;
}
}
if ( ( oldMdiMode = = KMdi : : ToplevelMode ) & & ! tq parentWidget( ) )
if ( ( oldMdiMode = = KMdi : : ToplevelMode ) & & ! parentWidget( ) )
{
{
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
@ -1662,7 +1662,7 @@ void KMdiMainFrm::finishTabPageMode()
TQSize mins = pView - > tqminimumSize ( ) ;
TQSize mins = pView - > tqminimumSize ( ) ;
TQSize maxs = pView - > tqmaximumSize ( ) ;
TQSize maxs = pView - > tqmaximumSize ( ) ;
TQSize sz = pView - > size ( ) ;
TQSize sz = pView - > size ( ) ;
TQWidget * pParent = pView - > tq parentWidget( ) ;
TQWidget * pParent = pView - > parentWidget( ) ;
TQPoint p ( pParent - > mapToGlobal ( pParent - > pos ( ) ) - pParent - > pos ( ) + m_undockPositioningOffset ) ;
TQPoint p ( pParent - > mapToGlobal ( pParent - > pos ( ) ) - pParent - > pos ( ) + m_undockPositioningOffset ) ;
m_documentTabWidget - > removePage ( pView ) ;
m_documentTabWidget - > removePage ( pView ) ;
pView - > reparent ( 0 , 0 , p ) ;
pView - > reparent ( 0 , 0 , p ) ;
@ -1688,7 +1688,7 @@ void KMdiMainFrm::finishTabPageMode()
void KMdiMainFrm : : setupTabbedDocumentViewSpace ( )
void KMdiMainFrm : : setupTabbedDocumentViewSpace ( )
{
{
// resize to childframe mode size of the mainwindow if we were in toplevel mode
// resize to childframe mode size of the mainwindow if we were in toplevel mode
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! tq parentWidget( ) )
if ( ( m_mdiMode = = KMdi : : ToplevelMode ) & & ! parentWidget( ) )
{
{
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMinimumHeight ( m_oldMainFrmMinHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
setMaximumHeight ( m_oldMainFrmMaxHeight ) ;
@ -1933,18 +1933,18 @@ void KMdiMainFrm::setupToolViewsForIDEALMode()
if ( mainDock - > parentDockTabGroup ( ) )
if ( mainDock - > parentDockTabGroup ( ) )
w = static_cast < KDockWidget * > ( mainDock - > parentDockTabGroup ( ) - > parent ( ) ) ;
w = static_cast < KDockWidget * > ( mainDock - > parentDockTabGroup ( ) - > parent ( ) ) ;
TQPtrList < KDockWidget > leftRe tq parentWidgets;
TQPtrList < KDockWidget > leftRe parentWidgets;
TQPtrList < KDockWidget > rightRe tq parentWidgets;
TQPtrList < KDockWidget > rightRe parentWidgets;
TQPtrList < KDockWidget > bottomRe tq parentWidgets;
TQPtrList < KDockWidget > bottomRe parentWidgets;
TQPtrList < KDockWidget > topRe tq parentWidgets;
TQPtrList < KDockWidget > topRe parentWidgets;
if ( mainDock - > parentDockTabGroup ( ) )
if ( mainDock - > parentDockTabGroup ( ) )
mainDock = static_cast < KDockWidget * > ( mainDock - > parentDockTabGroup ( ) - > parent ( ) ) ;
mainDock = static_cast < KDockWidget * > ( mainDock - > parentDockTabGroup ( ) - > parent ( ) ) ;
findToolViewsDockedToMain ( & leftRe tq parentWidgets, KDockWidget : : DockLeft ) ;
findToolViewsDockedToMain ( & leftRe parentWidgets, KDockWidget : : DockLeft ) ;
findToolViewsDockedToMain ( & rightRe tq parentWidgets, KDockWidget : : DockRight ) ;
findToolViewsDockedToMain ( & rightRe parentWidgets, KDockWidget : : DockRight ) ;
findToolViewsDockedToMain ( & bottomRe tq parentWidgets, KDockWidget : : DockBottom ) ;
findToolViewsDockedToMain ( & bottomRe parentWidgets, KDockWidget : : DockBottom ) ;
findToolViewsDockedToMain ( & topRe tq parentWidgets, KDockWidget : : DockTop ) ;
findToolViewsDockedToMain ( & topRe parentWidgets, KDockWidget : : DockTop ) ;
mainDock - > setEnableDocking ( KDockWidget : : DockNone ) ; //::DockCorner);
mainDock - > setEnableDocking ( KDockWidget : : DockNone ) ; //::DockCorner);
mainDock - > setDockSite ( KDockWidget : : DockCorner ) ;
mainDock - > setDockSite ( KDockWidget : : DockCorner ) ;
@ -1996,10 +1996,10 @@ void KMdiMainFrm::setupToolViewsForIDEALMode()
m_topContainer - > setDockSite ( KDockWidget : : DockCenter ) ;
m_topContainer - > setDockSite ( KDockWidget : : DockCenter ) ;
m_bottomContainer - > setDockSite ( KDockWidget : : DockCenter ) ;
m_bottomContainer - > setDockSite ( KDockWidget : : DockCenter ) ;
dockToolViewsIntoContainers ( leftRe tq parentWidgets, m_leftContainer ) ;
dockToolViewsIntoContainers ( leftRe parentWidgets, m_leftContainer ) ;
dockToolViewsIntoContainers ( rightRe tq parentWidgets, m_rightContainer ) ;
dockToolViewsIntoContainers ( rightRe parentWidgets, m_rightContainer ) ;
dockToolViewsIntoContainers ( bottomRe tq parentWidgets, m_bottomContainer ) ;
dockToolViewsIntoContainers ( bottomRe parentWidgets, m_bottomContainer ) ;
dockToolViewsIntoContainers ( topRe tq parentWidgets, m_topContainer ) ;
dockToolViewsIntoContainers ( topRe parentWidgets, m_topContainer ) ;
dockManager - > setSpecialLeftDockContainer ( m_leftContainer ) ;
dockManager - > setSpecialLeftDockContainer ( m_leftContainer ) ;
@ -2078,7 +2078,7 @@ void KMdiMainFrm::finishIDEAlMode( bool full )
TQSize mins = pView - > tqminimumSize ( ) ;
TQSize mins = pView - > tqminimumSize ( ) ;
TQSize maxs = pView - > tqmaximumSize ( ) ;
TQSize maxs = pView - > tqmaximumSize ( ) ;
TQSize sz = pView - > size ( ) ;
TQSize sz = pView - > size ( ) ;
TQWidget * pParent = pView - > tq parentWidget( ) ;
TQWidget * pParent = pView - > parentWidget( ) ;
TQPoint p ( pParent - > mapToGlobal ( pParent - > pos ( ) ) - pParent - > pos ( ) + m_undockPositioningOffset ) ;
TQPoint p ( pParent - > mapToGlobal ( pParent - > pos ( ) ) - pParent - > pos ( ) + m_undockPositioningOffset ) ;
pView - > reparent ( 0 , 0 , p ) ;
pView - > reparent ( 0 , 0 , p ) ;
pView - > reparent ( 0 , 0 , p ) ;
pView - > reparent ( 0 , 0 , p ) ;
@ -2101,7 +2101,7 @@ void KMdiMainFrm::finishIDEAlMode( bool full )
}
}
else
else
{
{
pParent = pParent - > tq parentWidget( ) ;
pParent = pParent - > parentWidget( ) ;
}
}
}
}
while ( pParent & & ! pDockW ) ;
while ( pParent & & ! pDockW ) ;
@ -2262,10 +2262,10 @@ void KMdiMainFrm::setSysButtonsAtMenuPosition()
{
{
if ( m_pMainMenuBar = = 0L )
if ( m_pMainMenuBar = = 0L )
return ;
return ;
if ( m_pMainMenuBar - > tq parentWidget( ) = = 0L )
if ( m_pMainMenuBar - > parentWidget( ) = = 0L )
return ;
return ;
int menuW = m_pMainMenuBar - > tq parentWidget( ) - > width ( ) ;
int menuW = m_pMainMenuBar - > parentWidget( ) - > width ( ) ;
int h ;
int h ;
int y ;
int y ;
if ( frameDecorOfAttachedViews ( ) = = KMdi : : Win95Look )
if ( frameDecorOfAttachedViews ( ) = = KMdi : : Win95Look )