#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 );
void HYDROGUI_InputPanel::insertWidget( QWidget* theWidget, int theIndex, int theStretch )
{
- QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
- aMainLayout->insertWidget( theIndex, theWidget, 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, int theStretch )
{
- QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
- aMainLayout->addLayout( theLayout, theStretch );
+ 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;
+}
class QPushButton;
class QLayout;
class QCloseEvent;
+class QSplitter;
class HYDROGUI_Module;
Q_OBJECT
public:
- HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout = true );
+ HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout = true, bool isSplitter = false );
virtual ~HYDROGUI_InputPanel();
void addWidget( QWidget* theWidget, int theStretch = 0 );
QFrame* buttonFrame() const;
virtual void closeEvent ( QCloseEvent * event );
+ QSplitter* splitter() const;
+
QPushButton* myCancel;
QPushButton* myHelp;
QFrame* myBtnFrame;
QPushButton* myApplyAndClose;
QPushButton* myApply;
+ QSplitter* mySplitter;
};
#endif
#include <QMouseEvent>
HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_ViewerDlg( theModule, theTitle ),
+: HYDROGUI_ViewerDlg( theModule, theTitle, true ),
myName( NULL )
{
QFrame* name_frame = new QFrame( mainFrame() );
myName = new QLineEdit(this);
name_layout->addWidget(myName);
- insertWidget( name_frame, 0, 0);
+ insertWidget( name_frame, 0, 0 );
int anActionFlags =
CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode |
#include <HYDROData_Profile.h>
HYDROGUI_ProfileInterpolateDlg::HYDROGUI_ProfileInterpolateDlg( HYDROGUI_Module* theModule, const QString& theTitle )
- : HYDROGUI_ViewerDlg( theModule, theTitle )
+ : HYDROGUI_ViewerDlg( theModule, theTitle, false )
{
QWidget* main = new QGroupBox( mainFrame() );
QGridLayout* base = new QGridLayout( main );
#include <QLineEdit>
#include <QMouseEvent>
-HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter )
+: HYDROGUI_InputPanel( theModule, theTitle, true, isSplitter )
{
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
{
if ( e->type() == QEvent::Polish )
{
- addWidget( myCoordLabel->parentWidget(), 4 );
+ //addWidget( myCoordLabel->parentWidget(), 4 );
Handle(AIS_Trihedron) aTrihedron = trihedron();
Handle(AIS_InteractiveContext) anAISContext = getAISContext();
Q_OBJECT
public:
- HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter );
virtual ~HYDROGUI_ViewerDlg();
Handle(AIS_InteractiveContext) getAISContext();