The target options are now saved in the program settings.
[kdbg.git] / DockWidget / docksplitter.cpp
blobe1278cbdb720d963f7d91f38013aa3e1545b08df
1 /***************************************************************************
2 DockSplitter part of KDEStudio
3 -------------------
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 )
15 o = orient;
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;
32 updateName();
34 KNewPanner::activate( first, last );
35 resizeEvent(0);
38 void DockSplitter::setSeparatorPos( int pos )
40 KNewPanner::setSeparatorPos( pos );
41 resizeEvent(0);
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();
50 if ( o == Vertical )
51 ((DockWidget*)parentWidget())->splitterOrientation = 0;
52 else
53 ((DockWidget*)parentWidget())->splitterOrientation = 1;
55 QWidget* p = (DockSplitter*)parent()->parent();
56 if ( p != 0L )
57 if ( p->isA("DockSplitter") ) ((DockSplitter*)p)->updateName();