]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
PAL10019 - preferences for SUPERVGraph
authorasl <asl@opencascade.com>
Tue, 8 Nov 2005 09:01:51 +0000 (09:01 +0000)
committerasl <asl@opencascade.com>
Tue, 8 Nov 2005 09:01:51 +0000 (09:01 +0000)
src/LightApp/LightApp_Application.cxx
src/LightApp/Makefile.in
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_msg_en.po
src/SalomeApp/resources/SalomeApp.xml

index 2a7cce67f1562ae72e809206907b12d89f5da130..d6c503e68dc741442b5ed53c0f8bd4d46043770b 100644 (file)
 #include <SVTK_ViewManager.h>
 #include <VTKViewer_ViewModel.h>
 
+#include <SUPERVGraph_ViewModel.h>
+#include <SUPERVGraph_ViewFrame.h>
+#include <SUPERVGraph_ViewManager.h>
+
 #include <qdir.h>
 #include <qimage.h>
 #include <qstring.h>
@@ -1020,17 +1024,32 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
   SUIT_ViewManager* viewMgr = 0;
-  if ( vmType == GLViewer_Viewer::Type() )
+  if( vmType == GLViewer_Viewer::Type() )
   {
     viewMgr = new GLViewer_ViewManager( activeStudy(), desktop() );
     new LightApp_GLSelector( (GLViewer_Viewer2d*)viewMgr->getViewModel(), mySelMgr );
   }
-  else if ( vmType == Plot2d_Viewer::Type() )
+  else if( vmType == Plot2d_Viewer::Type() )
   {
     viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() );
-    viewMgr->setViewModel( new SPlot2d_Viewer() );// custom view model, which extends SALOME_View interface
+    SPlot2d_Viewer* vm = new SPlot2d_Viewer();
+    viewMgr->setViewModel( vm  );// custom view model, which extends SALOME_View interface 
+    Plot2d_ViewWindow* wnd = dynamic_cast<Plot2d_ViewWindow*>( viewMgr->getActiveView() );
+    if( wnd )
+    {
+      Plot2d_ViewFrame* frame = wnd->getViewFrame();
+      frame->setBackgroundColor( resMgr->colorValue( "Plot2d", "Background", frame->backgroundColor() ) );
+    }
   }
-  else if ( vmType == OCCViewer_Viewer::Type() )
+  else if( vmType == SUPERVGraph_Viewer::Type() )
+  {
+    viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop() );
+    SUPERVGraph_Viewer* vm = new SUPERVGraph_Viewer();
+    SUPERVGraph_ViewFrame* view = dynamic_cast<SUPERVGraph_ViewFrame*>( vm->getViewManager()->getActiveView() );
+    if( view )
+      view->setBackgroundColor( resMgr->colorValue( "SUPERVGraph", "Background", view->backgroundColor() ) );
+  }
+  else if( vmType == OCCViewer_Viewer::Type() )
   {
     viewMgr = new OCCViewer_ViewManager( activeStudy(), desktop() );
     SOCC_Viewer* vm = new SOCC_Viewer();
@@ -1425,6 +1444,8 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
 
   int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), viewTab );
 
+  int supervGroup = pref->addPreference( tr( "PREF_GROUP_SUPERV" ), viewTab );
+
   pref->setItemProperty( occGroup, "columns", 1 );
   pref->setItemProperty( vtkGroup, "columns", 1 );
   pref->setItemProperty( plot2dGroup, "columns", 1 );
@@ -1525,6 +1546,13 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( dirGroup, "columns", 1 );
   pref->addPreference( tr( "" ), dirGroup,
                       LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
+
+  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), supervGroup,
+                      LightApp_Preferences::Color, "SUPERVGraph", "Background" );
+  pref->addPreference( tr( "PREF_SUPERV_TITLE_COLOR" ), supervGroup,
+                      LightApp_Preferences::Color, "SUPERVGraph", "Title" );
+//  pref->addPreference( tr( "PREF_SUPERV_CTRL_COLOR" ), supervGroup,
+//                    LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" );
 }
 
 /*!Changed preferences */
index dc1d74cda4d5b9c56debe5a45ea71c0911e1b5ef..2c0a57df87967b3e21971fc1b090ff3a0828357e 100755 (executable)
@@ -109,6 +109,6 @@ RESOURCES_FILES = icon_about.png \
 CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES)
 
 LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS)
-LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSOCC -lSVTK -lPyInterp -lPythonConsole
+LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSOCC -lSVTK -lSPlot2d -lSUPERVGraph -lPyInterp -lPythonConsole
 
 @CONCLUDE@
index b5884f858a229a31e7c1aedd4767161530ad8b4d..2e18989f4e10965348f8870ffe6adad28b11286b 100644 (file)
     <parameter value="true" name="ShowLegend" />
     <parameter value="0" name="VerScaleMode" />
   </section>
+  <section name="SUPERVGraph" >
+    <parameter value="144, 208, 211" name="Background" />
+    <parameter value="63, 213, 255" name="Title" />
+  </section>
   <!-- Here go optional sections for other modules -->
   <section name="resources">
     <parameter name="salome" value="${KERNEL_ROOT_DIR}/share/salome/res"/>
index f5c4a8f895c5f8e96603fff984ebb73bd5c44cc9..6aa610229b31133d2ea1c680c9422933d57ebf0b 100644 (file)
@@ -195,6 +195,18 @@ msgstr "Quick directory list"
 msgid "LightApp_Application::MEN_REFRESH"
 msgstr "Refresh"
 
+msgid "LightApp_Application::PREF_GROUP_SUPERV"
+msgstr "Graph Supervisor"
+
+msgid "LightApp_Application::PREF_GROUP_SUPERV"
+msgstr "Graph Supervisor"
+
+msgid "LightApp_Application::PREF_SUPERV_TITLE_COLOR"
+msgstr "Title color"
+
+msgid "LightApp_Application::PREF_SUPERV_CTRL_COLOR"
+msgstr "Ctrl color"
+
 //=======================================================================================
 
 msgid "LightApp_PreferencesDlg::CAPTION"
@@ -249,4 +261,3 @@ msgstr "&Cancel"
 
 msgid "LightApp_ModuleDlg::ActivateComponent_DESCRIPTION"
 msgstr "Create, open or load study."
-
index c88091e482b91b9130d8a1ca34f32cd6494fba5e..6d9862512579bd914d04367768778727b91a9aa4 100644 (file)
     <parameter value="true" name="ShowLegend" />
     <parameter value="0" name="VerScaleMode" />
   </section>
+  <section name="SUPERVGraph" >
+    <parameter value="144, 208, 211" name="Background" />
+    <parameter value="63, 213, 255" name="Title" />
+  </section>
   <section name="Geometry" >
     <parameter value="10" name="SettingsGeomStep" />
     <parameter value="0"  name="display_mode" />