1 /***************************************************************************
2 DockSplitter part of KDEStudio
4 copyright : (C) 1999 by Judin Max
5 email : novaprint@mtu-net.ru
6 ***************************************************************************/
8 #include "docksplitter.h"
9 #include "dockmanager.h"
10 #include <qapplication.h>
12 DockSplitter::DockSplitter(QWidget
*parent
, const char *name
, Orientation orient
, Units units
, int pos
)
13 : KNewPanner( parent
, name
, orient
, units
, pos
)
18 DockSplitter::~DockSplitter()
22 QWidget
* DockSplitter::getAnother( QWidget
* w
)
24 return ( w
== first
) ? last
: first
;
27 void DockSplitter::activate( QWidget
*c0
, QWidget
*c1
)
29 if ( c0
!= 0L ) first
= c0
;
30 if ( c1
!= 0L ) last
= c1
;
34 KNewPanner::activate( first
, last
);
38 void DockSplitter::setSeparatorPos( int pos
)
40 KNewPanner::setSeparatorPos( pos
);
44 void DockSplitter::updateName()
46 parentWidget()->setName( QString( first
->name() ) + "," + last
->name() );
47 parentWidget()->repaint( false );
48 ((DockWidget
*)parentWidget())->firstName
= first
->name();
49 ((DockWidget
*)parentWidget())->lastName
= last
->name();
51 ((DockWidget
*)parentWidget())->splitterOrientation
= 0;
53 ((DockWidget
*)parentWidget())->splitterOrientation
= 1;
55 QWidget
* p
= (DockSplitter
*)parent()->parent();
57 if ( p
->isA("DockSplitter") ) ((DockSplitter
*)p
)->updateName();