#include <QLayout>
#include <QPushButton>
#include <QDir>
+#include <QSplitter>
-HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout )
+HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle,
+ bool doInitLayout, bool isSplitter )
#ifdef LIGHT_MODE
: QDockWidget( 0 ),
#else
QBoxLayout* aMainLayout = new QVBoxLayout( myMainFrame );
aMainLayout->setMargin( 0 );
aMainLayout->setSpacing( 5 );
+ if( isSplitter )
+ {
+ mySplitter = new QSplitter( myMainFrame );
+ mySplitter->setOrientation( Qt::Vertical );
+ aMainLayout->addWidget( mySplitter, 1 );
+ }
+ else
+ mySplitter = 0;
aLayout->addWidget( myMainFrame, 1 );
emit panelCancel();
}
+void HYDROGUI_InputPanel::insertWidget( QWidget* theWidget, int theIndex, int theStretch )
+{
+ if( mySplitter )
+ {
+ mySplitter->insertWidget( theIndex, theWidget );
+ mySplitter->setStretchFactor( theIndex, theStretch );
+ }
+ else
+ {
+ QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
+ aMainLayout->insertWidget( theIndex, theWidget, theStretch );
+ }
+}
+
void HYDROGUI_InputPanel::addWidget( QWidget* theWidget, int theStretch )
{
- QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
- aMainLayout->addWidget( theWidget, theStretch );
+ if( mySplitter )
+ {
+ int s = mySplitter->count();
+ mySplitter->addWidget( theWidget );
+ mySplitter->setStretchFactor( s, theStretch );
+ }
+ else
+ {
+ QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
+ aMainLayout->addWidget( theWidget, theStretch );
+ }
}
-void HYDROGUI_InputPanel::addLayout( QLayout* theLayout )
+void HYDROGUI_InputPanel::addLayout( QLayout* theLayout, int theStretch )
{
- QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
- aMainLayout->addLayout( theLayout );
+ if( mySplitter )
+ {
+ }
+ else
+ {
+ QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
+ aMainLayout->addLayout( theLayout, theStretch );
+ }
}
void HYDROGUI_InputPanel::addStretch()
{
- QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
- aMainLayout->addStretch();
+ if( mySplitter )
+ {
+ }
+ else
+ {
+ QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
+ aMainLayout->addStretch();
+ }
}
QFrame* HYDROGUI_InputPanel::mainFrame() const
{
return myBtnFrame;
}
+
+QSplitter* HYDROGUI_InputPanel::splitter() const
+{
+ return mySplitter;
+}