From 3f6c0b630c9f5909c33ada8d227409591b5054e7 Mon Sep 17 00:00:00 2001 From: stv Date: Sun, 26 Feb 2006 10:18:23 +0000 Subject: [PATCH] no message --- src/LightApp/LightApp_ModuleDlg.cxx | 396 +++++++++--------- src/LightApp/LightApp_NameDlg.cxx | 256 +++++------ src/LightApp/LightApp_Study.h | 146 +++---- .../resources/view_graduated_axes.png | Bin 351 -> 5 bytes 4 files changed, 399 insertions(+), 399 deletions(-) diff --git a/src/LightApp/LightApp_ModuleDlg.cxx b/src/LightApp/LightApp_ModuleDlg.cxx index 28b37d92f..b067b0e5d 100644 --- a/src/LightApp/LightApp_ModuleDlg.cxx +++ b/src/LightApp/LightApp_ModuleDlg.cxx @@ -16,201 +16,201 @@ // // See http://www.salome-platform.org/ // -// File : LightApp_ModuleDlg.cxx -// Author : Michael Zorin (mzn) -// Module : LightApp - -#include - -#include -#include -#include -#include -#include - -#ifndef WIN32 -using namespace std; -#endif - -/*!Default icon*/ -static const char* const default_icon[] = { -"48 48 17 1", -". c None", -"# c #161e4c", -"b c #1d3638", -"e c #2f585b", -"i c #345b5e", -"c c #386266", -"g c #3f7477", -"d c #4d8589", -"m c #519099", -"o c #6abbc1", -"a c #70c9d3", -"f c #79ddea", -"n c #7adff2", -"k c #7ce2f4", -"j c #993550", -"h c #d84b71", -"l c #ef537d", -"................................................", -"................................................", -"................................................", -"................................................", -"................................................", -"................########.########.########......", -"...............#aaaaaa###aaaaaa###aaaaaa##......", -"..............#aaaaaa#b#aaaaaa#b#aaaaaa#c#......", -".............########b########b########cc#......", -".............#dddddd#b#dddddd#b#dddddd#cc#......", -"...........########d########d########d#cc#......", -"..........#aaaaaa###aaaaaa###aaaaaa##d#cc#......", -".........#aaaaaa#b#aaaaaa#b#aaaaaa#c#d#cc#......", -"........########b########e########cc#d#c#.......", -"........#dddddd#b#dddddd#e#ffffff#cc#d####......", -"......########d########d########f#cc###g##......", -".....#aaaaaa###aaaaaa###hhhhhh##f#cc#gg#c#......", -"....#aaaaaa#b#aaaaaa#i#hhhhhh#j#f#cc###cc#......", -"...########b########i########jj#f#c#gg#cc#......", -"...#kkkkkk#b#kkkkkk#i#llllll#jj#f####g#cc#......", -"...#kkkkkk#b#kkkkkk#i#llllll#jj###m##g#cc#......", -"...#knnkkk#b#kkkkkk#i#llllll#jj#mm#c#g#cc#......", -"...#knnkkk#b#kkkkkk#i#llllll#jj###cc#g#c#.......", -"...#kkkkkk#b#kkkkkk#i#llllll#j#dd#cc#g####......", -"...#kkkkkk###kkkkkk###llllll####d#cc###g##......", -"...########g########g########o##d#cc#gg#c#......", -"....#gggggg#b#gggggg#b#oooooo#c#d#cc###cc#......", -"...########b########b########cc#d#c#gg#cc#......", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#d####g#cc#......", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###g##g#cc#......", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#gg#c#g#cc#......", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###cc#g#c#.......", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#c#gg#cc#g##........", -"...#kkkkkk###kkkkkk###kkkkkk####g#cc###.........", -"...########g########g########g##g#cc#...........", -"....#gggggg#b#gggggg#b#gggggg#c#g#cc#...........", -"...########b########b########cc#g#c#............", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#g##.............", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###..............", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#................", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#................", -"...#kkkkkk#b#kkkkkk#b#kkkkkk#c#.................", -"...#kkkkkk###kkkkkk###kkkkkk##..................", -"...########.########.########...................", -"................................................", -"................................................", -"................................................", -"................................................"}; - -//============================================================================================================================== -/*! - * LightApp_ModuleDlg::LightApp_ModuleDlg \n - * - * Constructor. - */ -//============================================================================================================================== -LightApp_ModuleDlg::LightApp_ModuleDlg ( QWidget * parent, const QString& component, const QPixmap icon ) - : QDialog ( parent, "ActivateModuleDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - QPixmap defaultIcon( ( const char** ) default_icon ); - setCaption( tr( "CAPTION" ) ); - setSizeGripEnabled( TRUE ); - - QGridLayout* ActivateModuleDlgLayout = new QGridLayout( this ); - ActivateModuleDlgLayout->setMargin( 11 ); ActivateModuleDlgLayout->setSpacing( 6 ); - - // Module's name and icon - myComponentFrame = new QFrame( this, "myComponentFrame" ); - myComponentFrame->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ) ); - myComponentFrame->setMinimumHeight( 100 ); - myComponentFrame->setFrameStyle( QFrame::Box | QFrame::Sunken ); - - QGridLayout* myComponentFrameLayout = new QGridLayout( myComponentFrame ); - myComponentFrameLayout->setMargin( 11 ); myComponentFrameLayout->setSpacing( 6 ); - - // --> icon - myComponentIcon = new QLabel( myComponentFrame, "myComponentIcon" ); - myComponentIcon->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); - myComponentIcon->setPixmap( !icon.isNull() ? icon : defaultIcon ); - myComponentIcon->setScaledContents( false ); - myComponentIcon->setAlignment( AlignCenter ); - // --> name - myComponentLab = new QLabel( component, myComponentFrame, "myComponentLab" ); - QFont fnt = myComponentLab->font(); fnt.setBold( TRUE ); myComponentLab->setFont( fnt ); - myComponentLab->setAlignment( AlignCenter ); - - myComponentFrameLayout->addWidget( myComponentIcon, 0, 0 ); - myComponentFrameLayout->addWidget( myComponentLab, 0, 1 ); - - // Info - QVBoxLayout* infoLayout = new QVBoxLayout(); - infoLayout->setMargin( 0 ); infoLayout->setSpacing( 6 ); - - // --> top line - QFrame* myLine1 = new QFrame( this, "myLine1" ); - myLine1->setFrameStyle( QFrame::HLine | QFrame::Plain ); - // --> info label - myInfoLabel = new QLabel( tr ("ActivateComponent_DESCRIPTION"), this, "myInfoLabel" ); - myInfoLabel->setAlignment( AlignCenter ); - // --> bottom line - QFrame* myLine2 = new QFrame( this, "myLine2" ); - myLine2->setFrameStyle( QFrame::HLine | QFrame::Plain ); - - infoLayout->addStretch(); - infoLayout->addWidget( myLine1 ); - infoLayout->addWidget( myInfoLabel ); - infoLayout->addWidget( myLine2 ); - infoLayout->addStretch(); - - // Buttons - QHBoxLayout* btnLayout = new QHBoxLayout(); - btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 ); - - // --> New - myNewBtn = new QPushButton( tr( "NEW" ), this, "myNewBtn" ); - myNewBtn->setDefault( true ); myNewBtn->setAutoDefault( true ); - // --> Open - myOpenBtn = new QPushButton( tr( "OPEN" ), this, "myOpenBtn" ); - myOpenBtn->setAutoDefault( true ); - // --> Load - myLoadBtn = new QPushButton( tr( "LOAD" ), this, "myLoadBtn" ); - myLoadBtn->setAutoDefault( true ); - // --> Cancel - myCancelBtn = new QPushButton( tr( "CANCEL" ), this, "myCancelBtn" ); - myCancelBtn->setAutoDefault( true ); - - btnLayout->addWidget( myNewBtn ); - btnLayout->addWidget( myOpenBtn ); - btnLayout->addWidget( myLoadBtn ); - btnLayout->addStretch(); - btnLayout->addSpacing( 70 ); - btnLayout->addStretch(); - btnLayout->addWidget( myCancelBtn ); - - ActivateModuleDlgLayout->addWidget( myComponentFrame, 0, 0 ); - ActivateModuleDlgLayout->addLayout( infoLayout, 0, 1 ); - ActivateModuleDlgLayout->addMultiCellLayout( btnLayout, 1, 1, 0, 1 ); - - // signals and slots connections - connect( myNewBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); - connect( myOpenBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); - connect( myLoadBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); - connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -//============================================================================================================================== -/*! - * LightApp_ModuleDlg::onButtonClicked - * - * Buttons slot - */ -//============================================================================================================================== -void LightApp_ModuleDlg::onButtonClicked() -{ - QPushButton* btn = ( QPushButton* )sender(); - if ( btn == myNewBtn ) - done( 1 ); - if ( btn == myOpenBtn ) - done( 2 ); - if ( btn == myLoadBtn ) - done( 3 ); -} +// File : LightApp_ModuleDlg.cxx +// Author : Michael Zorin (mzn) +// Module : LightApp + +#include + +#include +#include +#include +#include +#include + +#ifndef WIN32 +using namespace std; +#endif + +/*!Default icon*/ +static const char* const default_icon[] = { +"48 48 17 1", +". c None", +"# c #161e4c", +"b c #1d3638", +"e c #2f585b", +"i c #345b5e", +"c c #386266", +"g c #3f7477", +"d c #4d8589", +"m c #519099", +"o c #6abbc1", +"a c #70c9d3", +"f c #79ddea", +"n c #7adff2", +"k c #7ce2f4", +"j c #993550", +"h c #d84b71", +"l c #ef537d", +"................................................", +"................................................", +"................................................", +"................................................", +"................................................", +"................########.########.########......", +"...............#aaaaaa###aaaaaa###aaaaaa##......", +"..............#aaaaaa#b#aaaaaa#b#aaaaaa#c#......", +".............########b########b########cc#......", +".............#dddddd#b#dddddd#b#dddddd#cc#......", +"...........########d########d########d#cc#......", +"..........#aaaaaa###aaaaaa###aaaaaa##d#cc#......", +".........#aaaaaa#b#aaaaaa#b#aaaaaa#c#d#cc#......", +"........########b########e########cc#d#c#.......", +"........#dddddd#b#dddddd#e#ffffff#cc#d####......", +"......########d########d########f#cc###g##......", +".....#aaaaaa###aaaaaa###hhhhhh##f#cc#gg#c#......", +"....#aaaaaa#b#aaaaaa#i#hhhhhh#j#f#cc###cc#......", +"...########b########i########jj#f#c#gg#cc#......", +"...#kkkkkk#b#kkkkkk#i#llllll#jj#f####g#cc#......", +"...#kkkkkk#b#kkkkkk#i#llllll#jj###m##g#cc#......", +"...#knnkkk#b#kkkkkk#i#llllll#jj#mm#c#g#cc#......", +"...#knnkkk#b#kkkkkk#i#llllll#jj###cc#g#c#.......", +"...#kkkkkk#b#kkkkkk#i#llllll#j#dd#cc#g####......", +"...#kkkkkk###kkkkkk###llllll####d#cc###g##......", +"...########g########g########o##d#cc#gg#c#......", +"....#gggggg#b#gggggg#b#oooooo#c#d#cc###cc#......", +"...########b########b########cc#d#c#gg#cc#......", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#d####g#cc#......", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###g##g#cc#......", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#gg#c#g#cc#......", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###cc#g#c#.......", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#c#gg#cc#g##........", +"...#kkkkkk###kkkkkk###kkkkkk####g#cc###.........", +"...########g########g########g##g#cc#...........", +"....#gggggg#b#gggggg#b#gggggg#c#g#cc#...........", +"...########b########b########cc#g#c#............", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#g##.............", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc###..............", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#................", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#cc#................", +"...#kkkkkk#b#kkkkkk#b#kkkkkk#c#.................", +"...#kkkkkk###kkkkkk###kkkkkk##..................", +"...########.########.########...................", +"................................................", +"................................................", +"................................................", +"................................................"}; + +//============================================================================================================================== +/*! + * LightApp_ModuleDlg::LightApp_ModuleDlg \n + * + * Constructor. + */ +//============================================================================================================================== +LightApp_ModuleDlg::LightApp_ModuleDlg ( QWidget * parent, const QString& component, const QPixmap icon ) + : QDialog ( parent, "ActivateModuleDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +{ + QPixmap defaultIcon( ( const char** ) default_icon ); + setCaption( tr( "CAPTION" ) ); + setSizeGripEnabled( TRUE ); + + QGridLayout* ActivateModuleDlgLayout = new QGridLayout( this ); + ActivateModuleDlgLayout->setMargin( 11 ); ActivateModuleDlgLayout->setSpacing( 6 ); + + // Module's name and icon + myComponentFrame = new QFrame( this, "myComponentFrame" ); + myComponentFrame->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + myComponentFrame->setMinimumHeight( 100 ); + myComponentFrame->setFrameStyle( QFrame::Box | QFrame::Sunken ); + + QGridLayout* myComponentFrameLayout = new QGridLayout( myComponentFrame ); + myComponentFrameLayout->setMargin( 11 ); myComponentFrameLayout->setSpacing( 6 ); + + // --> icon + myComponentIcon = new QLabel( myComponentFrame, "myComponentIcon" ); + myComponentIcon->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); + myComponentIcon->setPixmap( !icon.isNull() ? icon : defaultIcon ); + myComponentIcon->setScaledContents( false ); + myComponentIcon->setAlignment( AlignCenter ); + // --> name + myComponentLab = new QLabel( component, myComponentFrame, "myComponentLab" ); + QFont fnt = myComponentLab->font(); fnt.setBold( TRUE ); myComponentLab->setFont( fnt ); + myComponentLab->setAlignment( AlignCenter ); + + myComponentFrameLayout->addWidget( myComponentIcon, 0, 0 ); + myComponentFrameLayout->addWidget( myComponentLab, 0, 1 ); + + // Info + QVBoxLayout* infoLayout = new QVBoxLayout(); + infoLayout->setMargin( 0 ); infoLayout->setSpacing( 6 ); + + // --> top line + QFrame* myLine1 = new QFrame( this, "myLine1" ); + myLine1->setFrameStyle( QFrame::HLine | QFrame::Plain ); + // --> info label + myInfoLabel = new QLabel( tr ("ActivateComponent_DESCRIPTION"), this, "myInfoLabel" ); + myInfoLabel->setAlignment( AlignCenter ); + // --> bottom line + QFrame* myLine2 = new QFrame( this, "myLine2" ); + myLine2->setFrameStyle( QFrame::HLine | QFrame::Plain ); + + infoLayout->addStretch(); + infoLayout->addWidget( myLine1 ); + infoLayout->addWidget( myInfoLabel ); + infoLayout->addWidget( myLine2 ); + infoLayout->addStretch(); + + // Buttons + QHBoxLayout* btnLayout = new QHBoxLayout(); + btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 ); + + // --> New + myNewBtn = new QPushButton( tr( "NEW" ), this, "myNewBtn" ); + myNewBtn->setDefault( true ); myNewBtn->setAutoDefault( true ); + // --> Open + myOpenBtn = new QPushButton( tr( "OPEN" ), this, "myOpenBtn" ); + myOpenBtn->setAutoDefault( true ); + // --> Load + myLoadBtn = new QPushButton( tr( "LOAD" ), this, "myLoadBtn" ); + myLoadBtn->setAutoDefault( true ); + // --> Cancel + myCancelBtn = new QPushButton( tr( "CANCEL" ), this, "myCancelBtn" ); + myCancelBtn->setAutoDefault( true ); + + btnLayout->addWidget( myNewBtn ); + btnLayout->addWidget( myOpenBtn ); + btnLayout->addWidget( myLoadBtn ); + btnLayout->addStretch(); + btnLayout->addSpacing( 70 ); + btnLayout->addStretch(); + btnLayout->addWidget( myCancelBtn ); + + ActivateModuleDlgLayout->addWidget( myComponentFrame, 0, 0 ); + ActivateModuleDlgLayout->addLayout( infoLayout, 0, 1 ); + ActivateModuleDlgLayout->addMultiCellLayout( btnLayout, 1, 1, 0, 1 ); + + // signals and slots connections + connect( myNewBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); + connect( myOpenBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); + connect( myLoadBtn, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); + connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); +} + +//============================================================================================================================== +/*! + * LightApp_ModuleDlg::onButtonClicked + * + * Buttons slot + */ +//============================================================================================================================== +void LightApp_ModuleDlg::onButtonClicked() +{ + QPushButton* btn = ( QPushButton* )sender(); + if ( btn == myNewBtn ) + done( 1 ); + if ( btn == myOpenBtn ) + done( 2 ); + if ( btn == myLoadBtn ) + done( 3 ); +} diff --git a/src/LightApp/LightApp_NameDlg.cxx b/src/LightApp/LightApp_NameDlg.cxx index 3af8513c9..609927305 100644 --- a/src/LightApp/LightApp_NameDlg.cxx +++ b/src/LightApp/LightApp_NameDlg.cxx @@ -16,131 +16,131 @@ // // See http://www.salome-platform.org/ // -// File : LightApp_NameDlg.cxx -// Author : Vadim SANDLER -// $Header$ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#ifndef WIN32 -using namespace std; -#endif - -/*! - Constructor -*/ -LightApp_NameDlg::LightApp_NameDlg( QWidget* parent ) -: QDialog( parent ? parent : NULL,//application()->desktop(), -"LightApp_NameDlg", -true, -WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - setCaption( tr("TLT_RENAME") ); - setSizeGripEnabled( TRUE ); - - QVBoxLayout* topLayout = new QVBoxLayout( this ); - topLayout->setMargin( 11 ); topLayout->setSpacing( 6 ); - - /***************************************************************/ - QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); - GroupC1->setColumnLayout(0, Qt::Vertical ); - GroupC1->layout()->setMargin( 0 ); GroupC1->layout()->setSpacing( 0 ); - QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1->layout() ); - GroupC1Layout->setAlignment( Qt::AlignTop ); - GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 ); - - QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" ); - TextLabel->setText( tr( "NAME_LBL" ) ); - GroupC1Layout->addWidget( TextLabel ); - - myLineEdit = new QLineEdit( GroupC1, "LineEdit1" ); - myLineEdit->setMinimumSize( 250, 0 ); - GroupC1Layout->addWidget( myLineEdit ); - - /***************************************************************/ - QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setMargin( 0 ); GroupButtons->layout()->setSpacing( 0 ); - QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 ); - - myButtonOk = new QPushButton( GroupButtons, "buttonOk" ); - myButtonOk->setText( tr( "BUT_OK" ) ); - myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( myButtonOk ); - - GroupButtonsLayout->addStretch(); - - myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" ); - myButtonCancel->setText( tr( "BUT_CANCEL" ) ); - myButtonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( myButtonCancel ); - /***************************************************************/ - - topLayout->addWidget( GroupC1 ); - topLayout->addWidget( GroupButtons ); - - // signals and slots connections - connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - - /* Move widget on the botton right corner of main widget */ - SUIT_Tools::centerWidget( this, parent ); -} - -/*! - Destructor -*/ -LightApp_NameDlg::~LightApp_NameDlg() -{ -} - -/*! - Sets name -*/ -void LightApp_NameDlg::setName( const QString& name ) -{ - myLineEdit->setText( name ); - myLineEdit->end(false); - myLineEdit->home(true); -} - -/*! - Returns name entered by user -*/ -QString LightApp_NameDlg::name() -{ - return myLineEdit->text(); -} - -void LightApp_NameDlg::accept() -{ - if ( name().stripWhiteSpace().isEmpty() ) - return; - QDialog::accept(); -} - -/*! - Creates modal dialog and returns name entered [ static ] -*/ -QString LightApp_NameDlg::getName( QWidget* parent, const QString& oldName ) -{ - QString n; - LightApp_NameDlg* dlg = new LightApp_NameDlg( parent ); - if ( !oldName.isNull() ) - dlg->setName( oldName ); - if ( dlg->exec() == QDialog::Accepted ) - n = dlg->name(); - delete dlg; - return n; -} +// File : LightApp_NameDlg.cxx +// Author : Vadim SANDLER +// $Header$ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifndef WIN32 +using namespace std; +#endif + +/*! + Constructor +*/ +LightApp_NameDlg::LightApp_NameDlg( QWidget* parent ) +: QDialog( parent ? parent : NULL,//application()->desktop(), +"LightApp_NameDlg", +true, +WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +{ + setCaption( tr("TLT_RENAME") ); + setSizeGripEnabled( TRUE ); + + QVBoxLayout* topLayout = new QVBoxLayout( this ); + topLayout->setMargin( 11 ); topLayout->setSpacing( 6 ); + + /***************************************************************/ + QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" ); + GroupC1->setColumnLayout(0, Qt::Vertical ); + GroupC1->layout()->setMargin( 0 ); GroupC1->layout()->setSpacing( 0 ); + QHBoxLayout* GroupC1Layout = new QHBoxLayout( GroupC1->layout() ); + GroupC1Layout->setAlignment( Qt::AlignTop ); + GroupC1Layout->setMargin( 11 ); GroupC1Layout->setSpacing( 6 ); + + QLabel* TextLabel = new QLabel( GroupC1, "TextLabel1" ); + TextLabel->setText( tr( "NAME_LBL" ) ); + GroupC1Layout->addWidget( TextLabel ); + + myLineEdit = new QLineEdit( GroupC1, "LineEdit1" ); + myLineEdit->setMinimumSize( 250, 0 ); + GroupC1Layout->addWidget( myLineEdit ); + + /***************************************************************/ + QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); + GroupButtons->setColumnLayout(0, Qt::Vertical ); + GroupButtons->layout()->setMargin( 0 ); GroupButtons->layout()->setSpacing( 0 ); + QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + GroupButtonsLayout->setMargin( 11 ); GroupButtonsLayout->setSpacing( 6 ); + + myButtonOk = new QPushButton( GroupButtons, "buttonOk" ); + myButtonOk->setText( tr( "BUT_OK" ) ); + myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE ); + GroupButtonsLayout->addWidget( myButtonOk ); + + GroupButtonsLayout->addStretch(); + + myButtonCancel = new QPushButton( GroupButtons, "buttonCancel" ); + myButtonCancel->setText( tr( "BUT_CANCEL" ) ); + myButtonCancel->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( myButtonCancel ); + /***************************************************************/ + + topLayout->addWidget( GroupC1 ); + topLayout->addWidget( GroupButtons ); + + // signals and slots connections + connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + + /* Move widget on the botton right corner of main widget */ + SUIT_Tools::centerWidget( this, parent ); +} + +/*! + Destructor +*/ +LightApp_NameDlg::~LightApp_NameDlg() +{ +} + +/*! + Sets name +*/ +void LightApp_NameDlg::setName( const QString& name ) +{ + myLineEdit->setText( name ); + myLineEdit->end(false); + myLineEdit->home(true); +} + +/*! + Returns name entered by user +*/ +QString LightApp_NameDlg::name() +{ + return myLineEdit->text(); +} + +void LightApp_NameDlg::accept() +{ + if ( name().stripWhiteSpace().isEmpty() ) + return; + QDialog::accept(); +} + +/*! + Creates modal dialog and returns name entered [ static ] +*/ +QString LightApp_NameDlg::getName( QWidget* parent, const QString& oldName ) +{ + QString n; + LightApp_NameDlg* dlg = new LightApp_NameDlg( parent ); + if ( !oldName.isNull() ) + dlg->setName( oldName ); + if ( dlg->exec() == QDialog::Accepted ) + n = dlg->name(); + delete dlg; + return n; +} diff --git a/src/LightApp/LightApp_Study.h b/src/LightApp/LightApp_Study.h index 1280fd99a..3714f2828 100644 --- a/src/LightApp/LightApp_Study.h +++ b/src/LightApp/LightApp_Study.h @@ -16,76 +16,76 @@ // // See http://www.salome-platform.org/ // -#ifndef LIGHTAPP_STUDY_H -#define LIGHTAPP_STUDY_H - -#include -#include - -#include -#include -#include - -#include "string" -#include "vector" - -class SUIT_Application; -class CAM_DataModel; - -class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study -{ - Q_OBJECT - -public: - LightApp_Study( SUIT_Application* ); - virtual ~LightApp_Study(); - - virtual void createDocument(); - virtual bool openDocument( const QString& ); - virtual bool loadDocument( const QString& ); - - virtual bool saveDocument(); - virtual bool saveDocumentAs( const QString& ); - - virtual void closeDocument(bool permanently = true); - - virtual bool isSaved() const; - virtual bool isModified() const; - - virtual void addComponent ( const CAM_DataModel* dm); - - virtual std::string GetTmpDir ( const char* theURL, const bool isMultiFile ); - - virtual QString componentDataType( const QString& ) const; - virtual QString referencedToEntry( const QString& ) const; - virtual bool isComponent( const QString& ) const; - virtual void children( const QString&, QStringList& ) const; - virtual void components( QStringList& ) const; - -protected: - virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles ); - virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles ); - virtual bool saveStudyData ( const QString& theFileName ); - virtual bool openStudyData ( const QString& theFileName ); - - virtual std::vector GetListOfFiles ( const char* theModuleName ) const; - virtual void SetListOfFiles ( const char* theModuleName, - const std::vector theListOfFiles ); - - virtual void RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const; - -protected: - virtual bool openDataModel ( const QString&, CAM_DataModel* ); - -signals: - void saved ( SUIT_Study* ); - void opened ( SUIT_Study* ); - void closed ( SUIT_Study* ); - void created( SUIT_Study* ); - - -private: - LightApp_Driver* myDriver; -}; - -#endif +#ifndef LIGHTAPP_STUDY_H +#define LIGHTAPP_STUDY_H + +#include +#include + +#include +#include +#include + +#include "string" +#include "vector" + +class SUIT_Application; +class CAM_DataModel; + +class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study +{ + Q_OBJECT + +public: + LightApp_Study( SUIT_Application* ); + virtual ~LightApp_Study(); + + virtual void createDocument(); + virtual bool openDocument( const QString& ); + virtual bool loadDocument( const QString& ); + + virtual bool saveDocument(); + virtual bool saveDocumentAs( const QString& ); + + virtual void closeDocument(bool permanently = true); + + virtual bool isSaved() const; + virtual bool isModified() const; + + virtual void addComponent ( const CAM_DataModel* dm); + + virtual std::string GetTmpDir ( const char* theURL, const bool isMultiFile ); + + virtual QString componentDataType( const QString& ) const; + virtual QString referencedToEntry( const QString& ) const; + virtual bool isComponent( const QString& ) const; + virtual void children( const QString&, QStringList& ) const; + virtual void components( QStringList& ) const; + +protected: + virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles ); + virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles ); + virtual bool saveStudyData ( const QString& theFileName ); + virtual bool openStudyData ( const QString& theFileName ); + + virtual std::vector GetListOfFiles ( const char* theModuleName ) const; + virtual void SetListOfFiles ( const char* theModuleName, + const std::vector theListOfFiles ); + + virtual void RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const; + +protected: + virtual bool openDataModel ( const QString&, CAM_DataModel* ); + +signals: + void saved ( SUIT_Study* ); + void opened ( SUIT_Study* ); + void closed ( SUIT_Study* ); + void created( SUIT_Study* ); + + +private: + LightApp_Driver* myDriver; +}; + +#endif diff --git a/src/VTKViewer/resources/view_graduated_axes.png b/src/VTKViewer/resources/view_graduated_axes.png index 9c9f3d20f9a1c9b43688dfbe06956373be0605fb..f1ad7558e4917c38d1dafc49f7bccac10219adee 100755 GIT binary patch literal 5 McmeAS@N?$^00ndbc>n+a literal 351 zcmV-l0igbgP)dQQu^Rd0_eIO zw%@u?(1n7uPDC){__FTiy$Y)`1rgEie0P3?Ss#1!gA65@4V7R-L}c4CHbQO3(CstyWOGV68Jhg&)CVui>>_|4@#Fvi002ovPDHLkV1hK&k+A>( -- 2.39.2